instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Flag, COUNT(Flag) FROM Ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM captain WHERE Rank = 'Midshipman') GROUP BY Flag ORDER BY COUNT(Flag) DESC | nvbench |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semes... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE program_course.course_id = course.course_id AND program_course.course_id = course.course_id AND program.name LIKE '%CS%' AND program.program_id = program_course.program_id AND semester.sem... | advising |
CREATE TABLE table_name_36 (
location___state VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Location/ State has a Date of 29 31 may?
| SELECT location___state FROM table_name_36 WHERE date = "29–31 may" | sql_create_context |
CREATE TABLE table_27636 (
"Series #" real,
"Title" text,
"Director" text,
"Writer" text,
"Air Date" text,
"Production Code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the episode 'rowley 1898' air?
| SELECT "Air Date" FROM table_27636 WHERE "Title" = 'Rowley 1898' | wikisql |
CREATE TABLE table_178389_1 (
location_of_the_church VARCHAR,
church_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of the church when the church name is Ortnevik Kyrkje?
| SELECT location_of_the_church FROM table_178389_1 WHERE church_name = "Ortnevik kyrkje" | sql_create_context |
CREATE TABLE table_4626 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place did T rlea come in at the European Indoor Championships?
| SELECT "Position" FROM table_4626 WHERE "Competition" = 'european indoor championships' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE table_24468 (
"Team" text,
"Sport" text,
"League" text,
"Established" real,
"Began in St. Louis" real,
"Venue" text,
"Championships in St. Louis" text,
"Left St. Louis" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What yea... | SELECT MIN("Began in St. Louis") FROM table_24468 WHERE "League" = 'Negro American League' | wikisql |
CREATE TABLE table_7747 (
"Year" real,
"Manufacturer" text,
"Start" real,
"Finish" real,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Before 2008, if the Manufacturer is dodge and the start is under 9, what's the highest finish time?
| SELECT MAX("Finish") FROM table_7747 WHERE "Manufacturer" = 'dodge' AND "Start" < '9' AND "Year" < '2008' | wikisql |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
... | SELECT County_name, Population FROM county | nvbench |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73693)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'right arm drai... | mimic_iii |
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.dob_year < "1882" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_35334 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the tournament played in Madrid, Spain?
| SELECT "Date" FROM table_35334 WHERE "Tournament" = 'madrid, spain' | wikisql |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),... | SELECT year, COUNT(year) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY year DESC | nvbench |
CREATE TABLE table_6248 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the game against the Golden State Warriors?
| SELECT "Score" FROM table_6248 WHERE "Opponent" = 'golden state warriors' | wikisql |
CREATE TABLE roller_coaster (
roller_coaster_id number,
name text,
park text,
country_id number,
length number,
height number,
speed text,
opened text,
status text
)
CREATE TABLE country (
country_id number,
name text,
population number,
area number,
languages te... | SELECT status, COUNT(*) FROM roller_coaster GROUP BY status | spider |
CREATE TABLE table_64130 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest silver number when the rank is smaller than 1?
| SELECT MAX("Silver") FROM table_64130 WHERE "Rank" < '1' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
C... | SELECT COUNT(DISTINCT down.PostId) FROM Votes AS down JOIN Posts ON down.PostId = Posts.Id JOIN PostHistory ON down.PostId = PostHistory.PostId AND PostHistory.CreationDate > down.CreationDate WHERE Posts.Score >= 0 AND down.VoteTypeId = 3 AND PostHistory.PostHistoryTypeId IN (4, 5, 6) | sede |
CREATE TABLE table_27657 (
"English" text,
"Latin" text,
"Proto-Italo-Western 1" text,
"Conservative Central Italian 1" text,
"Italian" text,
"Spanish" text,
"Catalan" text,
"Old French" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wha... | SELECT "Proto-Italo-Western 1" FROM table_27657 WHERE "English" = 'door' | 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 * FROM Users WHERE Location LIKE '%Nigeria%' ORDER BY Reputation DESC LIMIT 10 | sede |
CREATE TABLE table_name_2 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What did the home team score at Lake Oval?
| SELECT home_team AS score FROM table_name_2 WHERE venue = "lake oval" | sql_create_context |
CREATE TABLE table_20480 (
"Office" text,
"Type" text,
"Location" text,
"Elected" real,
"Term began" text,
"Term ended" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type had an election day in 1980
| SELECT "Type" FROM table_20480 WHERE "Elected" = '1980' | 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 * FROM PostTypes | sede |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | 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.RYBH = '27615170' AND jybgb.BGRQ BETWEEN '2013-04-02' AND '2021-... | css |
CREATE TABLE table_13173 (
"Date" text,
"Venue" text,
"Score" text,
"Competition" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Competition is 'ECQG5', and when Venue is 'Hampden Park , Glasgow (H)'?
| SELECT "Score" FROM table_13173 WHERE "Competition" = 'ecqg5' AND "Venue" = 'hampden park , glasgow (h)' | 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 WHERE demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS" AND demographic.age < "79" | mimicsql_data |
CREATE TABLE table_name_88 (
back VARCHAR,
supplier VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Back has a Supplier of Kooga and a Year of 2006-2008?
| SELECT back FROM table_name_88 WHERE supplier = "kooga" AND year = "2006-2008" | sql_create_context |
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.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 ... | css |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name | nvbench |
CREATE TABLE table_name_46 (
year INTEGER,
category VARCHAR,
award VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the earliest year that had a category of best supporting actress at the asian film awards?
| SELECT MIN(year) FROM table_name_46 WHERE category = "best supporting actress" AND award = "asian film awards" | sql_create_context |
CREATE TABLE table_20476 (
"Headphone Model" text,
"Headphone Class" text,
"Driver-matched dB" text,
"Construction" text,
"Earpads" text,
"Termination" text,
"US MSRP" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which headphone models hav... | SELECT "Headphone Model" FROM table_20476 WHERE "Driver-matched dB" = '0.1' AND "US MSRP" = '$49' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | 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-22988' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient... | eicu |
CREATE TABLE table_17612 (
"Country" text,
"Player name" text,
"Period" text,
"Position" text,
"Matches" text,
"Goals" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals were scored by the player who played 17 matches?
| SELECT "Goals" FROM table_17612 WHERE "Matches" = '17' | wikisql |
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_... | SELECT card_type_code, COUNT(card_type_code) FROM Customers_Cards GROUP BY card_type_code ORDER BY card_type_code DESC | nvbench |
CREATE TABLE table_8044 (
"Name" text,
"Death" text,
"Assumed Office" text,
"Left Office" text,
"Years in office" text,
"Monarch" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years in office were served by the person who assumed the o... | SELECT "Years in office" FROM table_8044 WHERE "Assumed Office" = 'october 4, 1886' | wikisql |
CREATE TABLE table_name_3 (
overall INTEGER,
pick__number VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Overall is the highest one that has a Pick # smaller than 9, and a Name of mike pearson?
| SELECT MAX(overall) FROM table_name_3 WHERE pick__number < 9 AND name = "mike pearson" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 40 AND 49) AND STRFTIME('%y', labevents.c... | mimic_iii |
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 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '46217483' AND t_kc22.STA_DATE BETWEEN '2002-01-13' AND '2018-10-07' AND t_kc21.MED_SER_ORG_NO = '4175604' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_55774 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for Boston's Home game that had Gerber as the d... | SELECT "Score" FROM table_55774 WHERE "Decision" = 'gerber' AND "Home" = 'boston' | wikisql |
CREATE TABLE table_23636 (
"Rank by time in office" real,
"Order in office" real,
"Vice President" text,
"Length of term in days" real,
"Explanation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the explanation for alben w. barkley
| SELECT "Explanation" FROM table_23636 WHERE "Vice President" = 'Alben W. Barkley' | wikisql |
CREATE TABLE table_15610 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Spring Creek School's area when the decile was 4?
| SELECT "Area" FROM table_15610 WHERE "Decile" = '4' AND "Name" = 'spring creek school' | wikisql |
CREATE TABLE table_23018775_3 (
avg_speed VARCHAR,
lap_four VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average speed where lap four's time was 22.9049?
| SELECT avg_speed FROM table_23018775_3 WHERE lap_four = "22.9049" | sql_create_context |
CREATE TABLE table_52594 (
"Date" text,
"Competition" text,
"Venue" text,
"Result" text,
"Score" text,
"Goals" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On 9/3/97, what was the score that resulted in a w?
| SELECT "Score" FROM table_52594 WHERE "Result" = 'w' AND "Date" = '9/3/97' | wikisql |
CREATE TABLE table_name_25 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team score that played at Kardinia Park?
| SELECT home_team AS score FROM table_name_25 WHERE venue = "kardinia park" | sql_create_context |
CREATE TABLE club (
clubid VARCHAR,
clubname VARCHAR
)
CREATE TABLE student (
lname VARCHAR,
stuid VARCHAR
)
CREATE TABLE member_of_club (
clubid VARCHAR,
stuid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the members of the club ... | SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" | sql_create_context |
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.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '张晴霞' AND t_kc21.MED_SER_ORG_NO = '1657281' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%煤工%' | css |
CREATE TABLE table_name_31 (
date VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day did philadelphia visit?
| SELECT date FROM table_name_31 WHERE visitor = "philadelphia" | sql_create_context |
CREATE TABLE table_76133 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score has charlton athletic as the away team?
| SELECT "Score" FROM table_76133 WHERE "Away team" = 'charlton athletic' | wikisql |
CREATE TABLE table_15187735_8 (
episode VARCHAR,
segment_b VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of episodes for s hacksaw
| SELECT COUNT(episode) FROM table_15187735_8 WHERE segment_b = "s Hacksaw" | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | SELECT JCZBDM, JCZBMC, JCZBJGDX, JCZBJGDL, JCZBJGDW, CKZFWXX, CKZFWSX FROM jyjgzbb WHERE BGDH = '34565955122' | css |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABL... | SELECT T2.middle_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id | nvbench |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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... | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Other preterm infants, 1,250-1,499 grams" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_8731 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who played against the Celtics on Sat. Feb. 23?
| SELECT "Opponent" FROM table_8731 WHERE "Date" = 'sat. feb. 23' | wikisql |
CREATE TABLE table_name_54 (
west_ham_wins INTEGER,
drawn INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least number of wins West Ham got when they tied 27 times?
| SELECT MIN(west_ham_wins) FROM table_name_54 WHERE drawn > 27 | 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 wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '11219115' UNION SELECT bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz... | css |
CREATE TABLE table_name_41 (
number_of_electorates__2009_ INTEGER,
constituency_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest Number of electorates (2009) with a Constituency number of total:?
| SELECT MAX(number_of_electorates__2009_) FROM table_name_41 WHERE constituency_number = "total:" | sql_create_context |
CREATE TABLE table_34046 (
"Callsign" text,
"Area served" text,
"Frequency" text,
"Band" text,
"On-air ID" text,
"Purpose" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what Area has the frequency of 100.3 and an On-air ID of yass fm?
| SELECT "Area served" FROM table_34046 WHERE "Frequency" = '100.3' AND "On-air ID" = 'yass fm' | wikisql |
CREATE TABLE table_72773 (
"#" text,
"Shipyard" text,
"Name" text,
"Laid down" text,
"Launched" text,
"Commissioned" text,
"Fleet" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the status of vessel number K-223?
| SELECT "Status" FROM table_72773 WHERE "#" = 'K-223' | wikisql |
CREATE TABLE table_name_21 (
rank VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank # of the swimmer in Lane 5?
| SELECT COUNT(rank) FROM table_name_21 WHERE lane = 5 | sql_create_context |
CREATE TABLE table_204_93 (
id number,
"round" number,
"pick" number,
"player" text,
"position" text,
"nationality" text,
"team" text,
"college" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- other draftee that attended tennessee state b... | SELECT "player" FROM table_204_93 WHERE "college" = 'tennessee state' AND "player" <> 'dick barnett' | squall |
CREATE TABLE table_72290 (
"Season" text,
"League" text,
"Rank" real,
"Games" real,
"Points" real,
"GF" real,
"GA" real,
"Manager" text,
"Top Scorer" text,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the top sco... | SELECT "Top Scorer" FROM table_72290 WHERE "GF" = '41' | wikisql |
CREATE TABLE table_2562572_44 (
population__2011_ INTEGER,
cyrillic_name_other_names VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the population of the settlement with the cyrillic name of ?
| SELECT MAX(population__2011_) FROM table_2562572_44 WHERE cyrillic_name_other_names = "Добрица" | sql_create_context |
CREATE TABLE table_5262 (
"Name" text,
"Number" real,
"Position" text,
"Weight*" real,
"Year" text,
"Hometown" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number with the f position in Dallas, Texas?
| SELECT COUNT("Number") FROM table_5262 WHERE "Position" = 'f' AND "Hometown" = 'dallas, texas' | wikisql |
CREATE TABLE table_7975 (
"Party" text,
"Seats" text,
"% of seats" text,
"First Pref votes" real,
"% FPv" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which % FPv has First Pref votes larger than 19,684, and Seats of 9?
| SELECT "% FPv" FROM table_7975 WHERE "First Pref votes" > '19,684' AND "Seats" = '9' | wikisql |
CREATE TABLE table_56164 (
"Date" text,
"Competition" text,
"Venue" text,
"Result" text,
"Score" text,
"Goals" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue has a Result of w, and a Goal of deacon 5/5?
| SELECT "Venue" FROM table_56164 WHERE "Result" = 'w' AND "Goals" = 'deacon 5/5' | wikisql |
CREATE TABLE table_75710 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Competition has a Venue of estadio alfonso lastras, san luis potos , mexico, and a... | SELECT "Competition" FROM table_75710 WHERE "Venue" = 'estadio alfonso lastras, san luis potosí, mexico' AND "Goal" > '15' | wikisql |
CREATE TABLE table_22982552_9 (
class_year INTEGER,
highlight_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What class year was the player whose highlights were 35 career INTs from?
| SELECT MIN(class_year) FROM table_22982552_9 WHERE highlight_s_ = "35 career INTs" | sql_create_context |
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 procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.short_title = "Contrast arteriogram-leg" | mimicsql_data |
CREATE TABLE table_30646 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. air date" text,
"Production code" real,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many millions... | SELECT "U.S. viewers (million)" FROM table_30646 WHERE "Written by" = 'Matthew Okumura' | wikisql |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | (SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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 j... | css |
CREATE TABLE table_name_64 (
date VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date is the circuit at wanneroo park?
| SELECT date FROM table_name_64 WHERE circuit = "wanneroo park" | sql_create_context |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT h.hours AS "hour", COUNT(counter) AS AmountOfActivity FROM (SELECT TIME_TO_STR(CreationDate, '%h') AS active, 1 AS counter FROM Posts WHERE OwnerUserId = 21216 UNION ALL SELECT TIME_TO_STR(CreationDate, '%h') AS active, 1 AS counter FROM Comments WHERE UserId = 21216) AS a RIGHT JOIN (SELECT DISTINCT TIME_TO_STR... | sede |
CREATE TABLE table_203_580 (
id number,
"title" text,
"release" number,
"genre" text,
"computer" text,
"console" text,
"handheld" text,
"smartphone" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many total action adventure genre gam... | SELECT COUNT("title") FROM table_203_580 WHERE "genre" = 'action-adventure' | squall |
CREATE TABLE table_12261714_2 (
young_rider_classification VARCHAR,
stage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who's the leader in the young rider classification in stage 12?
| SELECT young_rider_classification FROM table_12261714_2 WHERE stage = "12" | sql_create_context |
CREATE TABLE table_204_597 (
id number,
"main author" text,
"no. of patients" number,
"duration of follow-up years" number,
"linearized rate of infection" text,
"actuarial freedom from infective endocarditis" text
)
-- Using valid SQLite, answer the following questions for the tables provided ... | SELECT MAX("duration of follow-up years") FROM table_204_597 | squall |
CREATE TABLE lessons (
lesson_id number,
customer_id number,
lesson_status_code text,
staff_id number,
vehicle_id number,
lesson_date time,
lesson_time text,
price number
)
CREATE TABLE staff (
staff_id number,
staff_address_id number,
nickname text,
first_name text,
... | SELECT COUNT(*) FROM lessons WHERE lesson_status_code = "Cancelled" | spider |
CREATE TABLE wedding (
female_id VARCHAR,
year VARCHAR
)
CREATE TABLE people (
name VARCHAR,
people_id VARCHAR,
country VARCHAR,
is_male VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the names for all females from Canada having a weddi... | SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id WHERE T1.year = 2016 AND T2.is_male = 'F' AND T2.country = 'Canada' | sql_create_context |
CREATE TABLE table_name_79 (
opponents_in_the_final VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponents in the final has a Partner of olga lugina?
| SELECT opponents_in_the_final FROM table_name_79 WHERE partner = "olga lugina" | sql_create_context |
CREATE TABLE table_43309 (
"Rank" real,
"Name" text,
"Years" text,
"Matches" real,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years did the player ranked less than 8 and had 447 matches play?
| SELECT "Years" FROM table_43309 WHERE "Rank" < '8' AND "Matches" = '447' | wikisql |
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 WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.diagnosis = "CEREBRAL ANEURYSM/SDA" | mimicsql_data |
CREATE TABLE table_74478 (
"Rank" real,
"School" text,
"Appearances" real,
"Wins" real,
"Losses" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the sum of losses for wins less than 2 and rank of 10 with appearances larger than 3
| SELECT SUM("Losses") FROM table_74478 WHERE "Wins" < '2' AND "Rank" = '10' AND "Appearances" > '3' | wikisql |
CREATE TABLE table_name_37 (
silver INTEGER,
bronze VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many silver medals when the total was 2 and less than 1 bronze?
| SELECT SUM(silver) FROM table_name_37 WHERE bronze < 1 AND total = 2 | sql_create_context |
CREATE TABLE table_36638 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score in the game where the record was 10-9-7?
| SELECT "Score" FROM table_36638 WHERE "Record" = '10-9-7' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2177" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswe... | SELECT COUNT(*) AS "count" FROM Badges AS b WHERE (b.Name = '##name?Caucus##') AND (b.Date >= '##Date1?2010-01-01##') AND (b.Date <= '##Date2?2020-01-01##') GROUP BY b.Name LIMIT 100 | sede |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_name_72 (
stadium VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Gaelic Athletic Association stadium is located in Carrick-on-Shannon?
| SELECT stadium FROM table_name_72 WHERE location = "carrick-on-shannon" | sql_create_context |
CREATE TABLE table_name_88 (
year VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years had a Venue of eindhoven?
| SELECT COUNT(year) FROM table_name_88 WHERE venue = "eindhoven" | sql_create_context |
CREATE TABLE table_name_97 (
result VARCHAR,
surface VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the result for the clay surface edition on july 17, 1992?
| SELECT result FROM table_name_97 WHERE surface = "clay" AND date = "july 17, 1992" | sql_create_context |
CREATE TABLE table_30138 (
"Rnd" real,
"Circuit" text,
"GT Winning Car" text,
"SS Winning Car" text,
"A Winning Car" text,
"B Winning Car" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of b winning car a... | SELECT COUNT("B Winning Car") FROM table_30138 WHERE "SS Winning Car" = 'Bobby Archer, Tommy Archer' | wikisql |
CREATE TABLE table_2409041_2 (
written_by VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 446004 is the production code who are the writers?
| SELECT written_by FROM table_2409041_2 WHERE production_code = 446004 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "55221" | mimicsql_data |
CREATE TABLE table_name_6 (
rank VARCHAR,
opposition VARCHAR
)
-- 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_name_6 WHERE opposition = "tipperary" | sql_create_context |
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 employees (
EMPLOYEE_ID decimal(6,0... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Alcohol abuse-continuous" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_3 (
"Player" text,
"No." text,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many schools or teams had jalen rose
| SELECT COUNT("School/Club Team") FROM table_3 WHERE "Player" = 'Jalen Rose' | wikisql |
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 vitalperiodic (
vitalperiodicid number,
... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-66039')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce... | eicu |
CREATE TABLE table_name_85 (
wins INTEGER,
goals_for VARCHAR,
losses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team has the most wins with at least 18 goals and less than 5 losses?
| SELECT MAX(wins) FROM table_name_85 WHERE goals_for = 18 AND losses < 5 | sql_create_context |
CREATE TABLE table_25482 (
"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.
-- What w... | SELECT "High rebounds" FROM table_25482 WHERE "Date" = 'April 4' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.