instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Neutral, ACC_Percent FROM basketball_match ORDER BY All_Neutral DESC | nvbench |
CREATE TABLE table_29027 (
"Season" real,
"Series" text,
"Team Name" text,
"Races" real,
"Poles" real,
"Wins" real,
"Podiums" real,
"F/Laps" real,
"Points" text,
"Final Placing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What... | SELECT MAX("Poles") FROM table_29027 | wikisql |
CREATE TABLE table_name_70 (
year INTEGER,
winning_team VARCHAR,
losing_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the latest year that the Atlanta Braves won and the St. Louis Cardinals lost?
| SELECT MAX(year) FROM table_name_70 WHERE winning_team = "atlanta braves" AND losing_team = "st. louis cardinals" | sql_create_context |
CREATE TABLE Royal_Family (
Royal_Family_ID INTEGER,
Royal_Family_Details VARCHAR(255)
)
CREATE TABLE Tourist_Attraction_Features (
Tourist_Attraction_ID INTEGER,
Feature_ID INTEGER
)
CREATE TABLE Locations (
Location_ID INTEGER,
Location_Name VARCHAR(255),
Address VARCHAR(255),
Other_... | SELECT Visit_Date, COUNT(Visit_Date) FROM Visits ORDER BY Visit_Date DESC | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81223) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
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 jybgb.BBCJBW 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.RYBH = '53751020' AND jybgb.BGRQ BETWEEN '2000-10-30' AND '2002-02-06' UNI... | css |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2518 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'bupropion' ORDER BY prescriptions.startdate L... | mimic_iii |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794 AND admissions.dischtime IS NULL) ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_name_84 (
crowd INTEGER,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the smallest crowd size for the match played at Junction Oval?
| SELECT MIN(crowd) FROM table_name_84 WHERE venue = "junction oval" | sql_create_context |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE airline (
airline_code varchar,
airline_name ... | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'FF' | atis |
CREATE TABLE table_33058 (
"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 first week to have attendance of 65,866?
| SELECT MIN("Week") FROM table_33058 WHERE "Attendance" = '65,866' | wikisql |
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREAT... | SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_29925 (
"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 wa... | SELECT "Team" FROM table_29925 WHERE "High points" = 'Austin Daye (16)' | wikisql |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number ... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c... | advising |
CREATE TABLE table_name_34 (
gold INTEGER,
bronze VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of gold values that have bronze values over 0 and totals under 2?
| SELECT SUM(gold) FROM table_name_34 WHERE bronze > 0 AND total < 2 | sql_create_context |
CREATE TABLE table_name_24 (
score VARCHAR,
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of the 1996 Asian Cup Qualification on June 29, 1996?
| SELECT score FROM table_name_24 WHERE competition = "1996 asian cup qualification" AND date = "june 29, 1996" | sql_create_context |
CREATE TABLE table_4618 (
"Line" text,
"Color" text,
"Terminus" text,
"Length" text,
"Stations" text,
"Daily Ridership" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Daily ridership greater that 414 is associated with which length?
| SELECT "Length" FROM table_4618 WHERE "Daily Ridership" > '414' | wikisql |
CREATE TABLE table_name_90 (
seine_saint_denis VARCHAR,
paris VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS A Seine-Saint-Denis WITH A PARIS OF 12.1%?
| SELECT seine_saint_denis FROM table_name_90 WHERE paris = "12.1%" | sql_create_context |
CREATE TABLE table_name_2 (
attendance INTEGER,
result VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Attendance has a Result of w 24-14, and a Week smaller than 7?
| SELECT SUM(attendance) FROM table_name_2 WHERE result = "w 24-14" AND week < 7 | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
... | SELECT q.Id AS "post_link", COUNT(pf.FlagTypeId) FROM Posts AS q INNER JOIN Users AS u ON u.Id = q.OwnerUserId INNER JOIN PostHistory AS ph ON ph.Id = q.Id INNER JOIN PendingFlags AS pf ON pf.PostId = q.Id WHERE q.PostTypeId = 1 AND DATEDIFF(DAY, q.CreationDate, GETDATE()) > 365 AND q.Score = 0 AND q.AnswerCount = 0 AN... | sede |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home DESC | nvbench |
CREATE TABLE ref_colors (
color_description VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the description of all the colors.
| SELECT color_description FROM ref_colors | sql_create_context |
CREATE TABLE table_22421 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the ... | SELECT "Manner of departure" FROM table_22421 WHERE "Date of vacancy" = '25 August 2008' | wikisql |
CREATE TABLE table_72113 (
"Rnd" text,
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text,
"Pole position" text,
"Winning driver" text,
"Winning team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wha... | SELECT "Report" FROM table_72113 WHERE "Winning team" = 'Porsche North America' | wikisql |
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE ref_budget_codes (
budget_type_code text,
budget_type_description text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description text
)
CREATE TABLE stateme... | SELECT T1.statement_id, T2.statement_details FROM accounts AS T1 JOIN statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '张高驰' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2018-12-03' UNI... | css |
CREATE TABLE table_28304 (
"Branding" text,
"Callsign" text,
"Ch. #" text,
"Station Type" text,
"Power kW (ERP)" text,
"Location (Transmitter Site)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location that has a power of 5kw (10k... | SELECT "Location (Transmitter Site)" FROM table_28304 WHERE "Power kW (ERP)" = '5kW (10kW ERP)' | wikisql |
CREATE TABLE table_name_79 (
heat INTEGER,
lane VARCHAR,
mark VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest heat for a lane past 1 and mark of 1:48.61?
| SELECT MAX(heat) FROM table_name_79 WHERE lane > 1 AND mark = "1:48.61" | sql_create_context |
CREATE TABLE table_name_14 (
co_drivers VARCHAR,
year VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which co-driver was part of team Martini Lancia earlier than 1986?
| SELECT co_drivers FROM table_name_14 WHERE year < 1986 AND team = "martini lancia" | sql_create_context |
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
)
CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which grade is studying in classroom 103?
| SELECT DISTINCT grade FROM list WHERE classroom = 103 | spider |
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 jyjgzbb.CKZFWDX, jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '53877134131' | css |
CREATE TABLE table_201_9 (
id number,
"year" number,
"film title" text,
"duration" text,
"film type" text,
"shoot location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many films had a duration below 5 minutes ?
| SELECT COUNT("film title") FROM table_201_9 WHERE "duration" < 5 | squall |
CREATE TABLE table_train_147 (
"id" int,
"pregnancy_or_lactation" bool,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"obesity" bool,
"fasting_blood_glucose_fbg" float,
"heart_rate" int,
"body_mass_index_bmi" float,
"underweight" bool,
"NOUSE" float
)
-- Usin... | SELECT * FROM table_train_147 WHERE fasting_blood_glucose_fbg >= 7 | criteria2sql |
CREATE TABLE table_name_60 (
position INTEGER,
lost INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position when lost is less than 7?
| SELECT AVG(position) FROM table_name_60 WHERE lost < 7 | sql_create_context |
CREATE TABLE table_name_39 (
throws VARCHAR,
first VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many throws does PJ have?
| SELECT throws FROM table_name_39 WHERE first = "pj" | sql_create_context |
CREATE TABLE table_64706 (
"Date" text,
"Event" text,
"Heat/Semifinal/Final" text,
"Nation" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the men's 100m breaststroke in heat 6?
| SELECT "Date" FROM table_64706 WHERE "Event" = 'men''s 100m breaststroke' AND "Heat/Semifinal/Final" = 'heat 6' | wikisql |
CREATE TABLE table_20351295_2 (
legs_won VARCHAR,
high_checkout VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many legs has the player with high checkout of 80 won?
| SELECT legs_won FROM table_20351295_2 WHERE high_checkout = 80 | sql_create_context |
CREATE TABLE table_7189 (
"Episode Number" real,
"Air Date" text,
"Guest Host" text,
"Musical Guest (Song performed)" text,
"Coat Of Cash Wearing Celebrity" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the air date of episode 5?
| SELECT "Air Date" FROM table_7189 WHERE "Episode Number" = '5' | wikisql |
CREATE TABLE table_29728596_1 (
result VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the home match against FK Rudar Ugljevik?
| SELECT result FROM table_29728596_1 WHERE away_team = "FK Rudar Ugljevik" | sql_create_context |
CREATE TABLE table_11206 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What region has vinyl record listed as its format?
| SELECT "Region" FROM table_11206 WHERE "Format" = 'vinyl record' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
P... | SELECT NUMBER_TO_STR(COUNT(*), '##,###') AS Total, SUM(CASE WHEN UserId IS NULL THEN 0 ELSE 1 END) AS "have_user" FROM Votes WHERE VoteTypeId IS NULL | sede |
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 MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '59714640' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE SOC_SRT_DIRE_NM = '硫酸氢氯吡格雷片') | css |
CREATE TABLE table_63512 (
"Total fat" text,
"Saturated fat" text,
"Monounsaturated fat" text,
"Polyunsaturated fat" text,
"Smoke point" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the polyunsaturated fat with a smoke point of c (), a tot... | SELECT "Polyunsaturated fat" FROM table_63512 WHERE "Smoke point" = '°c ()' AND "Total fat" = '100g' AND "Monounsaturated fat" = '63g' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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 ... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_NM = '昌娜兰' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-03-16' AND '2020-01-01' AND t_kc21.CLINIC_TYPE = '住院' | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patientheal... | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724')) AND microlab.culturesite = 'blood, venipuncture' AND STRFTIM... | eicu |
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 T1.pname FROM player AS T1 JOIN tryout AS T2 ON T1.pid = T2.pid WHERE T2.decision = 'yes' AND T2.ppos = 'striker' | spider |
CREATE TABLE table_4576 (
"Commodity" text,
"2001-02" text,
"2002-03" text,
"2003-04" text,
"2004-05" text,
"2005-06" text,
"2006-07" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the production in 2004-05 for the commodity that pr... | SELECT "2004-05" FROM table_4576 WHERE "2005-06" = '1,037' | wikisql |
CREATE TABLE table_name_14 (
vehicles__per_1000__d INTEGER,
agri_culture_b INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Agri culture b larger than 12.6, what is the lowest vehicles per 1000?
| SELECT MIN(vehicles__per_1000__d) FROM table_name_14 WHERE agri_culture_b > 12.6 | sql_create_context |
CREATE TABLE procedures (
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "0" AND lab.itemid = "50896" | mimicsql_data |
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 SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '1033267' AND t_kc22.STA_DATE BETWEEN '2009-05-09' AND '2019-05-08' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc... | css |
CREATE TABLE table_name_18 (
year INTEGER,
director VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year is the latest year that has no under director?
| SELECT MAX(year) FROM table_name_18 WHERE director = "no" | 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 employees (
EMPLOYEE_ID decimal(6,0... | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_name_28 (
goals_for INTEGER,
lost VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Goals For has a Lost of 12, and a Played larger than 34?
| SELECT MAX(goals_for) FROM table_name_28 WHERE lost = 12 AND played > 34 | sql_create_context |
CREATE TABLE table_10807 (
"Year" real,
"Theme" text,
"Artist" text,
"Mintage" text,
"Issue Price" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What theme is associated with a year before 2006 and Issue Price of $25.22?
| SELECT "Theme" FROM table_10807 WHERE "Year" < '2006' AND "Issue Price" = '$25.22' | wikisql |
CREATE TABLE table_23014923_1 (
season VARCHAR,
primary__south__winners VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the season total number if the primary (South) winners is Ridings High 'A'?
| SELECT COUNT(season) FROM table_23014923_1 WHERE primary__south__winners = "Ridings High 'A'" | 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 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 table_9047 (
"Year" real,
"Winner" text,
"Score" text,
"Runner(s)-up" text,
"Course" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the course at midlothian, illinois for a year before 1934?
| SELECT "Course" FROM table_9047 WHERE "Year" < '1934' AND "Location" = 'midlothian, illinois' | wikisql |
CREATE TABLE table_name_38 (
historical_references VARCHAR,
podcast_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the historical reference of the episode that aired on October 23, 2005?
| SELECT historical_references FROM table_name_38 WHERE podcast_date = "october 23, 2005" | sql_create_context |
CREATE TABLE table_name_64 (
result VARCHAR,
year VARCHAR,
nominee_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result for a year after 2003, when the nominee(s) is john wells?
| SELECT result FROM table_name_64 WHERE year > 2003 AND nominee_s_ = "john wells" | sql_create_context |
CREATE TABLE table_20295 (
"#" real,
"Advocate # 1" text,
"Advocate # 2" text,
"Root of All Evil" text,
"Poll winner" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the poll winner for greg giraldo for porn
| SELECT "Poll winner" FROM table_20295 WHERE "Advocate # 2" = 'Greg Giraldo for Porn' | wikisql |
CREATE TABLE table_15176 (
"Goal" real,
"Date" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the result for 2000 afc asian cup qualification
| SELECT "Result" FROM table_15176 WHERE "Competition" = '2000 afc asian cup qualification' | wikisql |
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 T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter DESC | nvbench |
CREATE TABLE table_name_44 (
date VARCHAR,
location_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Date has a Location Attendance of reunion arena?
| SELECT date FROM table_name_44 WHERE location_attendance = "reunion arena" | sql_create_context |
CREATE TABLE table_18077 (
"Rank" real,
"Building" text,
"Address" text,
"Height" text,
"Storeys" real,
"Completed" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the minimum storeys on 325 5th ave n
| SELECT MIN("Storeys") FROM table_18077 WHERE "Address" = '325 5th Ave N' | wikisql |
CREATE TABLE table_name_88 (
february INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the February for the game against the Montreal Canadiens?
| SELECT SUM(february) FROM table_name_88 WHERE opponent = "montreal canadiens" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE 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.marital_status = "DIVORCED" AND lab.label = "MCV" | mimicsql_data |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ... | mimic_iii |
CREATE TABLE table_45391 (
"Year" real,
"Champion" text,
"Runner-Up" text,
"Result" text,
"Date" text,
"Venue" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the years where the attendance was 95,000 and... | SELECT SUM("Year") FROM table_45391 WHERE "Attendance" = '95,000' AND "Runner-Up" = 'dresdner sc' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
... | SELECT COUNT(*) FROM Posts AS p WHERE p.PostTypeId = 1 AND EXISTS(SELECT * FROM PostHistory AS ph INNER JOIN PostHistory AS ph2 ON ph2.PostId = ph.PostId AND ph2.PostHistoryTypeId IN (5) AND ph2.CreationDate > ph.CreationDate WHERE ph.PostId = p.Id AND ph.PostHistoryTypeId = 10) AND EXISTS(SELECT * FROM PostHistory AS ... | sede |
CREATE TABLE products (
product_details VARCHAR,
product_id VARCHAR
)
CREATE TABLE order_items (
product_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which product has been ordered most number of times?
| SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_27715173_8 (
date VARCHAR,
location_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the date when the location attendance is energysolutions arena 19,911?
| SELECT date FROM table_27715173_8 WHERE location_attendance = "EnergySolutions Arena 19,911" | sql_create_context |
CREATE TABLE table_22464308_2 (
malaysian_team_classification VARCHAR,
points_classification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which malaysian team classification had mohd nur rizuan zainal as points classification?
| SELECT malaysian_team_classification FROM table_22464308_2 WHERE points_classification = "Mohd Nur Rizuan Zainal" | sql_create_context |
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 * FROM jybgb WHERE jybgb.JZLSH = '61422826297' | css |
CREATE TABLE table_name_72 (
area__km_2__ INTEGER,
place VARCHAR,
population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the most area of Bochum Part 2 with a population less than 15,911?
| SELECT MAX(area__km_2__) FROM table_name_72 WHERE place = "bochum part 2" AND population < 15 OFFSET 911 | sql_create_context |
CREATE TABLE table_41619 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country is Lemd the ICAO of?
| SELECT "Country" FROM table_41619 WHERE "ICAO" = 'lemd' | wikisql |
CREATE TABLE table_name_17 (
season VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What season had 78 points?
| SELECT season FROM table_name_17 WHERE points = 78 | sql_create_context |
CREATE TABLE table_test_30 (
"id" int,
"ejection_fraction_ef" int,
"multiple_long_bone_fractures" bool,
"extracellular_volume_expansion" bool,
"pregnancy_or_lactation" bool,
"bleeding" int,
"serum_potassium" float,
"prosthetic_heart_valve" bool,
"hbg" int,
"anticoagulation" bool,... | SELECT * FROM table_test_30 WHERE kidney_disease = 1 AND estimated_glomerular_filtration_rate_egfr < 30 | criteria2sql |
CREATE TABLE table_train_199 (
"id" int,
"t2dm" bool,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"diabetic" string,
"hypoglycemia" bool,
"diabetes" bool,
"seizure_disorder" bool,
"glaucoma" bool,
"hypertension" bool,
"age" float,
"NOUSE" float
)
-- Using valid ... | SELECT * FROM table_train_199 WHERE glaucoma = 1 | criteria2sql |
CREATE TABLE table_41570 (
"Year" real,
"January" real,
"February" real,
"March" real,
"April" real,
"June" real,
"July" real,
"August" real,
"September" real,
"October" real,
"November" real,
"December" real,
"Annual Additions(in millions)" real,
"Average Monthly... | SELECT COUNT("October") FROM table_41570 WHERE "September" < '2.48' AND "Year" > '2002' AND "June" > '1.42' AND "February" < '7.44' | wikisql |
CREATE TABLE table_train_231 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"heart_disease" bool,
"stroke" bool,
"renal_disease" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"allergy_to_milk" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the table... | SELECT * FROM table_train_231 WHERE heart_disease = 1 OR stroke = 1 | criteria2sql |
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 Comments (
Id number,
PostId number,
Score numb... | SELECT * FROM Posts WHERE Id IN (SELECT AcceptedAnswerId FROM Posts WHERE NOT AcceptedAnswerId IS NULL ORDER BY Score LIMIT 1000) ORDER BY Score DESC LIMIT 1000 | sede |
CREATE TABLE movie (
mid int,
title text,
release_year int,
title_aka text,
budget text
)
CREATE TABLE cast (
id int,
msid int,
aid int,
role text
)
CREATE TABLE copyright (
id int,
msid int,
cid int
)
CREATE TABLE tags (
id int,
msid int,
kid int
)
CREATE... | SELECT birth_year FROM actor WHERE name = 'Ellen Page' | imdb |
CREATE TABLE table_19128 (
"Country or territory with flag" text,
"Area (km\u00b2) (per sqmi)" text,
"Population (July 2009 est.)" real,
"Population density per km\u00b2" text,
"Capital" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What unit of me... | SELECT "Area (km\u00b2) (per sqmi)" FROM table_19128 WHERE "Country or territory with flag" = 'Uruguay' | wikisql |
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER... | SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_Details | nvbench |
CREATE TABLE table_7784 (
"Year" real,
"Tournament" text,
"Surface" text,
"Round" text,
"Winner" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Round, when Winner is 'Ivanovic', when Year is less than 2008, and when Tournam... | SELECT "Round" FROM table_7784 WHERE "Winner" = 'ivanovic' AND "Year" < '2008' AND "Tournament" = 'paris' | wikisql |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = @UserId GROUP BY TagName ORDER BY UpVotes DESC | sede |
CREATE TABLE table_26702 (
"County" text,
"Exports (US$ mil)" text,
"Percent of total exports" text,
"Imports (US$ mil)" text,
"Percent of total imports" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the country is vest, what were the exports?... | SELECT "Exports (US$ mil)" FROM table_26702 WHERE "County" = 'Vest' | wikisql |
CREATE TABLE table_45254 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Bonus Points" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Please... | SELECT MAX("Losses") FROM table_45254 WHERE "Played" < '5' | wikisql |
CREATE TABLE table_1386 (
"Frequency" text,
"Station" text,
"Operator" text,
"Language" text,
"Genre" text,
"Coverage Area" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the genre for the hot fm station?
| SELECT "Genre" FROM table_1386 WHERE "Station" = 'Hot FM' | wikisql |
CREATE TABLE table_203_266 (
id number,
"group" text,
"members" number,
"caucusing" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what group has under 40 members but at least 2 caucusing ?
| SELECT "group" FROM table_203_266 WHERE "members" < 40 AND "caucusing" >= 2 | squall |
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age... | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality DESC | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT demographic.language FROM demographic WHERE demographic.name = "Anna Johnson" | mimicsql_data |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId... | SELECT answers.Id AS "post_link" FROM Votes AS v INNER JOIN Posts AS answers ON v.PostId = answers.Id INNER JOIN Posts AS questions ON answers.ParentId = questions.Id WHERE questions.OwnerUserId = @UserId AND answers.OwnerUserId != @UserID AND v.VoteTypeId = 1 | sede |
CREATE TABLE table_name_77 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game when the record was 18-20?
| SELECT score FROM table_name_77 WHERE record = "18-20" | sql_create_context |
CREATE TABLE table_name_29 (
poison_klesha VARCHAR,
pali VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the poison/klesha word for moha avijja in pali?
| SELECT poison_klesha FROM table_name_29 WHERE pali = "moha avijja" | sql_create_context |
CREATE TABLE table_1507431_1 (
runner_up VARCHAR,
no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are all runner-ups for No. 2?
| SELECT runner_up FROM table_1507431_1 WHERE no = 2 | sql_create_context |
CREATE TABLE table_1889233_2 (
parliament VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which parliament is sylvia lim swee lian?
| SELECT parliament FROM table_1889233_2 WHERE name = "Sylvia Lim Swee Lian" | 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 t_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '钱婉娜' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '814113') | css |
CREATE TABLE table_18640 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the election result for the candidate first elected in 1918?
| SELECT "Result" FROM table_18640 WHERE "First elected" = '1918' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11826) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bilirubin, total') AND STRFTIME('%y', labevents.charttime) = '2105' GROUP B... | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.