instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_13110459_2 (
overall VARCHAR,
viewers__m_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are all the overall with viewers (m) being 2.61
| SELECT overall FROM table_13110459_2 WHERE viewers__m_ = "2.61" | sql_create_context |
CREATE TABLE table_name_87 (
laps VARCHAR,
time_retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps have a Time/Retired of +12.5 secs?
| SELECT COUNT(laps) FROM table_name_87 WHERE time_retired = "+12.5 secs" | sql_create_context |
CREATE TABLE table_62411 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player with a t8 place?
| SELECT "Player" FROM table_62411 WHERE "Place" = 't8' | wikisql |
CREATE TABLE table_19369 (
"Team" text,
"Average" text,
"Points" real,
"Played" real,
"1986-87" text,
"1987-88" text,
"1988-89" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many points did the team that scored 38 points in the 1986-87 ... | SELECT MIN("1988-89") FROM table_19369 WHERE "1986-87" = '38' | wikisql |
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 name, COUNT(name) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = "Chiltern" GROUP BY name ORDER BY COUNT(name) | nvbench |
CREATE TABLE table_21062353_1 (
opponent VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the opponents of the Wildcats in game 4?
| SELECT opponent FROM table_21062353_1 WHERE game = 4 | sql_create_context |
CREATE TABLE table_49611 (
"Region (year)" text,
"No. 1" text,
"No. 2" text,
"No. 3" text,
"No. 4" text,
"No. 5" text,
"No. 6" text,
"No. 7" text,
"No. 8" text,
"No. 9" text,
"No. 10" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "No. 7" FROM table_49611 WHERE "Region (year)" = 'arizona (2010)' | wikisql |
CREATE TABLE table_name_59 (
party VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the party of Richard Simpson?
| SELECT party FROM table_name_59 WHERE name = "richard simpson" | sql_create_context |
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 jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjz... | css |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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 varc... | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_name_78 (
money___£__ VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much money does the player with a 68-71-68-72=279 score have?
| SELECT money___£__ FROM table_name_78 WHERE score = 68 - 71 - 68 - 72 = 279 | 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 * FROM gwyjzb WHERE gwyjzb.PERSON_NM = '俞阳泽' AND gwyjzb.MED_SER_ORG_NO = '0973581' AND NOT gwyjzb.MED_ORG_DEPT_NM LIKE '%医学科%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '俞阳泽' AND fgwyjzb.MED_SER_ORG_NO = '0973581' AND NOT fgwyjzb.MED_ORG_DEPT_NM LIKE '%医学科%' | css |
CREATE TABLE table_53846 (
"Species" text,
"Strain" text,
"Type" text,
"Base Pairs" real,
"Genes" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest base pair with a Strain of unspecified?
| SELECT MAX("Base Pairs") FROM table_53846 WHERE "Strain" = 'unspecified' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(qtb.IN_DIAG_DIS_CD) FROM qtb WHERE qtb.PERSON_ID = '63660143' AND qtb.IN_HOSP_DATE BETWEEN '2007-07-21' AND '2010-12-24' UNION SELECT COUNT(gyb.IN_DIAG_DIS_CD) FROM gyb WHERE gyb.PERSON_ID = '63660143' AND gyb.IN_HOSP_DATE BETWEEN '2007-07-21' AND '2010-12-24' UNION SELECT COUNT(zyb.IN_DIAG_DIS_CD) FROM zy... | css |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionheight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
CREATE TABLE companies (
id number,
name text,
headquarters text,
industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value_billion text
)
CREATE TABLE buildings (
id number,
name text,
city text,
height number,
stories number,
... | SELECT stories FROM buildings ORDER BY height DESC LIMIT 1 | spider |
CREATE TABLE table_name_89 (
opponent VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent when the score was 6-3, 6-3?
| SELECT opponent FROM table_name_89 WHERE score = "6-3, 6-3" | sql_create_context |
CREATE TABLE table_26844 (
"Seed" real,
"Rank" real,
"Player" text,
"Points" real,
"Points defending" text,
"Points won" real,
"New points" real,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was david ferrer seeded?
| SELECT MAX("Seed") FROM table_26844 WHERE "Player" = 'David Ferrer' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-171217') AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY patient.unitadmittime DESC LIM... | eicu |
CREATE TABLE table_203_254 (
id number,
"position" number,
"team" text,
"points" number,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"for" number,
"against" number,
"difference" number
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT COUNT("team") FROM table_203_254 | squall |
CREATE TABLE table_13762472_3 (
game INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the last game where the record was 6-3?
| SELECT MAX(game) FROM table_13762472_3 WHERE record = "6-3" | sql_create_context |
CREATE TABLE table_204_909 (
id number,
"pollutant" text,
"units" text,
"emission standard" number,
"coal-fired" text,
"petroleum coke-fired" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which pollutant had the same emission standard as pm10 ?... | SELECT "pollutant" FROM table_204_909 WHERE "pollutant" <> 'pm10' AND "emission standard" = (SELECT "emission standard" FROM table_204_909 WHERE "pollutant" = 'pm10') | squall |
CREATE TABLE table_name_69 (
location_attendance INTEGER,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance number for the Timberwolves game?
| SELECT SUM(location_attendance) FROM table_name_69 WHERE team = "timberwolves" | sql_create_context |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
star... | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MATSCIE' AND course.number = 480 AND instructor.name LIKE '%David Remy%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_i... | advising |
CREATE TABLE table_name_9 (
song VARCHAR,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What song was made by the sex pistols?
| SELECT song FROM table_name_9 WHERE artist = "sex pistols" | sql_create_context |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Compa... | SELECT title, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY title DESC | nvbench |
CREATE TABLE table_79246 (
"Round" text,
"Date" text,
"Opponents" text,
"Venue" text,
"Result" text,
"Score F\u2013A" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the round on 21 february 2009?
| SELECT "Round" FROM table_79246 WHERE "Date" = '21 february 2009' | wikisql |
CREATE TABLE table_204_823 (
id number,
"dates" text,
"location" text,
"attendance" text,
"official guests" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the only official guest on july 16-18 ?
| SELECT "official guests" FROM table_204_823 WHERE "dates" = 'july 16-18, 1982' | squall |
CREATE TABLE table_name_34 (
catalogue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the catalogue on october 15, 2004?
| SELECT catalogue FROM table_name_34 WHERE date = "october 15, 2004" | sql_create_context |
CREATE TABLE table_name_14 (
gold INTEGER,
silver INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest amount of gold for more than 16 silver?
| SELECT MIN(gold) FROM table_name_14 WHERE silver > 16 | sql_create_context |
CREATE TABLE table_47844 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text... | SELECT "2013" FROM table_47844 WHERE "2001" = 'qf' AND "2011" = '4r' | 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 procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Excision or destruction of other lesion or tissue of heart, open approach" AND lab.fluid = "Pleural" | mimicsql_data |
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 d_items (
row_id num... | SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11579) AND NOT transfers.careunit IS NULL AND STRFTIME('%y', transfers.intime) >= '2103' ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId num... | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ... | sede |
CREATE TABLE table_203_447 (
id number,
"constituency" number,
"region" text,
"name" text,
"party" text,
"last elected" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the first name on the table ?
| SELECT "name" FROM table_203_447 WHERE id = 1 | squall |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 2 * 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 comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
star... | SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 542 | advising |
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 SUM(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.PERSON_NM = '张昊焱' AND t_kc21.CLINIC_TYPE = '门诊' | css |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_name_15 (
region VARCHAR,
format VARCHAR,
label VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which region has the format CD and label MCA?
| SELECT region FROM table_name_15 WHERE format = "cd" AND label = "mca" | sql_create_context |
CREATE TABLE table_204_824 (
id number,
"no." number,
"train no:" text,
"origin" text,
"destination" text,
"train name" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many trains originate from mangalore central ?
| SELECT COUNT(*) FROM table_204_824 WHERE "origin" = 'mangalore central' | squall |
CREATE TABLE manufacturers (
code number,
name text,
headquarter text,
founder text,
revenue number
)
CREATE TABLE products (
code number,
name text,
price number,
manufacturer number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Select... | SELECT name, price FROM products WHERE price >= 180 ORDER BY price DESC, name | spider |
CREATE TABLE musical (
musical_id number,
name text,
year number,
award text,
category text,
nominee text,
result text
)
CREATE TABLE actor (
actor_id number,
name text,
musical_id number,
character text,
duration text,
age number
)
-- Using valid SQLite, answer th... | SELECT T1.name, T2.name FROM actor AS T1 JOIN musical AS T2 ON T1.musical_id = T2.musical_id | spider |
CREATE TABLE table_23325 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the ... | SELECT "Record" FROM table_23325 WHERE "High rebounds" = 'McWilliams (8)' | 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 diagnoses (
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND procedures.short_title = "Exc/des hrt les,endovasc" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41391')) AND lab.labname = 'rbc' AND DATETIME(lab.labresulttime) >= DATETIME(C... | 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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_31185 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Featured character(s)" text,
"U.S. viewers (millions)" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of... | SELECT "Title" FROM table_31185 WHERE "Featured character(s)" = 'Abbud Siddiqui' | wikisql |
CREATE TABLE table_75160 (
"Region" real,
"Group A" text,
"Group B" text,
"Group C" text,
"Group D" text,
"Group E" text,
"Group F" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the group C region with Illinois as group B?
| SELECT "Group C" FROM table_75160 WHERE "Group B" = 'illinois' | wikisql |
CREATE TABLE record (
id number,
result text,
swimmer_id number,
event_id number
)
CREATE TABLE swimmer (
id number,
name text,
nationality text,
meter_100 number,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
... | SELECT name FROM event ORDER BY year DESC | spider |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_62455 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Club of the Player with a Date of Birth of 1979-01-29?
| SELECT "Club" FROM table_62455 WHERE "Date of Birth" = '1979-01-29' | wikisql |
CREATE TABLE table_name_93 (
date VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the Catalog FT 507?
| SELECT date FROM table_name_93 WHERE catalog = "ft 507" | sql_create_context |
CREATE TABLE table_65863 (
"Rank" real,
"Player" text,
"County" text,
"Tally" text,
"Total" real,
"Opposition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total rank of the match with tipperary as the opposition?
| SELECT COUNT("Rank") FROM table_65863 WHERE "Opposition" = 'tipperary' | wikisql |
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Tota... | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE t_kc21 (
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 t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '12483440' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 5529.18) | css |
CREATE TABLE table_39407 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is cornell's lowest pick number?
| SELECT MIN("Pick #") FROM table_39407 WHERE "College" = 'cornell' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5395) ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '张... | css |
CREATE TABLE table_7057 (
"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 total of silver when gold is less than 0?
| SELECT SUM("Silver") FROM table_7057 WHERE "Gold" < '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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "LEFT COLON CANCER" AND procedures.short_title = "Temporary tracheostomy" | mimicsql_data |
CREATE TABLE third_party_companies (
company_id number,
company_type text,
company_name text,
company_address text,
other_company_details text
)
CREATE TABLE part_faults (
part_fault_id number,
part_id number,
fault_short_name text,
fault_description text,
other_fault_details te... | SELECT asset_make, asset_model, asset_details FROM assets ORDER BY asset_disposed_date | spider |
CREATE TABLE table_12703 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the away team for the game in Slough Town?
| SELECT "Away team" FROM table_12703 WHERE "Home team" = 'slough town' | wikisql |
CREATE TABLE table_21445 (
"Team #1" text,
"Points" text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When they played Universidad de Chile, what was the score of the first leg?
| SELECT COUNT("1st leg") FROM table_21445 WHERE "Team #2" = 'Universidad de Chile' | wikisql |
CREATE TABLE table_name_55 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result on 1990-11-04?
| SELECT result FROM table_name_55 WHERE date = "1990-11-04" | sql_create_context |
CREATE TABLE table_56031 (
"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.
-- How many points did the away team score when the... | SELECT "Away team score" FROM table_56031 WHERE "Home team score" = '16.12 (108)' | wikisql |
CREATE TABLE jobs (
job_id text,
job_title text,
min_salary number,
max_salary number
)
CREATE TABLE regions (
region_id number,
region_name text
)
CREATE TABLE locations (
location_id number,
street_address text,
postal_code text,
city text,
state_province text,
countr... | SELECT job_title, AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title | spider |
CREATE TABLE table_204_812 (
id number,
"#" number,
"prime minister" text,
"date of birth" text,
"start date\nof (first) term" text,
"age at beginning\nof (first) term" text,
"end date\nof (final) term" text,
"total time in\noffice" text,
"date of death" text,
"lifespan" text
)
... | SELECT COUNT("prime minister") FROM table_204_812 WHERE "age at beginning\nof (first) term" >= 50 | squall |
CREATE TABLE tv_series (
sid int,
title text,
release_year int,
num_of_seasons int,
num_of_episodes int,
title_aka text,
budget text
)
CREATE TABLE made_by (
id int,
msid int,
pid int
)
CREATE TABLE company (
id int,
name text,
country_code varchar
)
CREATE TABLE p... | SELECT company.name FROM company, copyright, tv_series WHERE copyright.cid = company.id AND tv_series.sid = copyright.msid AND tv_series.title = 'Mickey Mouse' | imdb |
CREATE TABLE residents_services (
resident_id number,
service_id number,
date_moved_in time,
property_id number,
date_requested time,
date_provided time,
other_details text
)
CREATE TABLE services (
service_id number,
organization_id number,
service_type_code text,
service_d... | SELECT T1.service_id, T1.service_details, COUNT(*) FROM services AS T1 JOIN residents_services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_46849 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ... | SELECT MAX("Drawn") FROM table_46849 WHERE "Position" = '14' AND "Goals For" > '66' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
H... | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4560557' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC | css |
CREATE TABLE table_name_50 (
date VARCHAR,
leading_scorer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was Carlos Boozer (23) the leading scorer?
| SELECT date FROM table_name_50 WHERE leading_scorer = "carlos boozer (23)" | sql_create_context |
CREATE TABLE table_2182562_1 (
wins VARCHAR,
avg_start VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins when the average start is 29.0?
| SELECT COUNT(wins) FROM table_2182562_1 WHERE avg_start = "29.0" | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId nu... | SELECT 1.0 * COUNT(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE NULL END) / COUNT(*) FROM Posts WHERE PostTypeId = 1 | sede |
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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.short_title = "IV infusion clofarabine" | mimicsql_data |
CREATE TABLE table_name_60 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many sets were played in the tournament that had 4R in 2011 and 2R in 2008?
| SELECT 2009 FROM table_name_60 WHERE 2011 = "4r" AND 2008 = "2r" | sql_create_context |
CREATE TABLE table_667 (
"Year" real,
"Finish position" text,
"1st day" text,
"2nd day" text,
"3rd day" text,
"4th Day" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the 3rd day with finbeingh position being 16th
| SELECT "3rd day" FROM table_667 WHERE "Finish position" = '16th' | wikisql |
CREATE TABLE table_name_62 (
home VARCHAR,
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the home team that played Vancouver on April 29?
| SELECT home FROM table_name_62 WHERE visitor = "vancouver" AND date = "april 29" | sql_create_context |
CREATE TABLE table_70691 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Date has a label of alfa records?
| SELECT "Date" FROM table_70691 WHERE "Label" = 'alfa records' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT DIRE_TYPE FROM t_kc22 WHERE MED_CLINIC_ID = '53117897919' AND SOC_SRT_DIRE_CD = '402418932-k' | css |
CREATE TABLE table_11838 (
"Name" text,
"Country" text,
"Reign began" text,
"Reign ended" text,
"Length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Pharaoh Seth's reign end?
| SELECT "Reign ended" FROM table_11838 WHERE "Name" = 'pharaoh seth' | wikisql |
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 = "WHITE - RUSSIAN" AND prescriptions.route = "IVPCA" | mimicsql_data |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No... | SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardi... | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'toxic myopathy') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY... | mimic_iii |
CREATE TABLE table_75150 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many extra points did right halfback Roswell W... | SELECT "Extra points" FROM table_75150 WHERE "Position" = 'right halfback' AND "Player" = 'roswell wendell' | wikisql |
CREATE TABLE table_name_25 (
company_or_product_name VARCHAR,
money_requested__£_ VARCHAR,
entrepreneur_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Company or Product name where Entrepreneurs Geoff and Colette Bell requested 75,000?
| SELECT company_or_product_name FROM table_name_25 WHERE money_requested__£_ = "75,000" AND entrepreneur_s_ = "geoff and colette bell" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '8578851' AND IN_HOSP_DATE BETWEEN '2002-07-20' AND '2012-04-08' AND CLINIC_TYPE = '购药' | css |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2034" AND lab.itemid = "51009" | mimicsql_data |
CREATE TABLE table_name_77 (
circuit VARCHAR,
session VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What circuit has qualifying as the session?
| SELECT circuit FROM table_name_77 WHERE session = "qualifying" | sql_create_context |
CREATE TABLE table_name_42 (
floors INTEGER,
height__m_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the fewest floors for the building that has a height of 116 meters?
| SELECT MIN(floors) FROM table_name_42 WHERE height__m_ = 116 | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | 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 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 txmzjzjlb.JZKSRQ FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '75820096573' UNION SELECT ftxmzjzjlb.JZKSRQ FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '75820096573' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | 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.drug = "Sucralfate" | mimicsql_data |
CREATE TABLE table_name_23 (
player VARCHAR,
to_par VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player has +3 to par and score of 75-72=147?
| SELECT player FROM table_name_23 WHERE to_par = "+3" AND score = 75 - 72 = 147 | sql_create_context |
CREATE TABLE table_name_19 (
score VARCHAR,
place VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the score for the t10 player from zimbabwe?
| SELECT score FROM table_name_19 WHERE place = "t10" AND country = "zimbabwe" | sql_create_context |
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 Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(10),
order_date D... | SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_id | nvbench |
CREATE TABLE table_46904 (
"Game" real,
"Date" real,
"Opponent" text,
"Score" text,
"Decision" text,
"Location/Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Opponent, when Location/Attendance is 'Mellon Ar... | SELECT "Opponent" FROM table_46904 WHERE "Location/Attendance" = 'mellon arena - 17,132' | wikisql |
CREATE TABLE player (
player_id number,
player text,
years_played text,
total_wl text,
singles_wl text,
doubles_wl text,
team number
)
CREATE TABLE team (
team_id number,
name text
)
CREATE TABLE match_season (
season number,
player text,
position text,
country numb... | SELECT T1.player, T1.years_played FROM player AS T1 JOIN team AS T2 ON T1.team = T2.team_id WHERE T2.name = "Columbus Crew" | spider |
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 FROM t_kc22 WHERE MED_CLINIC_ID = '75363192461' AND UP_LIMIT_AMO > 3738.33 | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.