instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_17492 (
"Subjects" text,
"First Year" text,
"Second Year" text,
"Third Year" text,
"Fourth Year" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many classes are taken in the third year when pag-unawa was taken in the first yea... | SELECT COUNT("Third Year") FROM table_17492 WHERE "First Year" = 'Pag-unawa' | wikisql |
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 COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '93292938' AND t_kc22.STA_DATE BETWEEN '2005-02-13' AND '2020-12-30' AND t_kc22.SELF_PAY_PRO < 0.34 | css |
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state varchar(20)
)
CREATE TABLE loan (
loan_ID varchar(3),
loan_type varchar(15),
cust_ID varchar(3),
branch_ID varchar(3)... | SELECT bname, SUM(amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.bname ORDER BY bname | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '30728995' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2002-08-27') | css |
CREATE TABLE documents_with_expenses (
document_id number,
budget_type_code text,
document_details text
)
CREATE TABLE documents (
document_id number,
document_type_code text,
project_id number,
document_date time,
document_name text,
document_description text,
other_details tex... | 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 table_name_12 (
name VARCHAR,
time VARCHAR,
lane VARCHAR,
heat VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which name has a Lane smaller than 3, a Heat larger than 4, and a Time of 2:00.80?
| SELECT name FROM table_name_12 WHERE lane < 3 AND heat > 4 AND time = "2:00.80" | sql_create_context |
CREATE TABLE table_23873 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Tar Heels points" real,
"Opponents" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times were Duke the opponents?
| SELECT COUNT("Opponents") FROM table_23873 WHERE "Opponent" = 'Duke' | wikisql |
CREATE TABLE table_15472061_1 (
original_air_date VARCHAR,
no_in_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of original air date for when the number in season is 10/11
| SELECT COUNT(original_air_date) FROM table_15472061_1 WHERE no_in_season = "10/11" | sql_create_context |
CREATE TABLE table_204_738 (
id number,
"season" number,
"level" text,
"division" text,
"section" text,
"position" text,
"movements" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times did they finish ninth ?
| SELECT COUNT(*) FROM table_204_738 WHERE "position" = 9 | squall |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'vancomycin - trough') | eicu |
CREATE TABLE table_37242 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Opponent of at san francisco 49ers had what lowest week?
| SELECT MIN("Week") FROM table_37242 WHERE "Opponent" = 'at san francisco 49ers' | wikisql |
CREATE TABLE table_name_64 (
report VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the report for 10 april
| SELECT report FROM table_name_64 WHERE date = "10 april" | sql_create_context |
CREATE TABLE table_52985 (
"Season" text,
"Pyramid Level" text,
"Regular Season 1" text,
"Playoffs 1" text,
"Regular Season 2" text,
"Playoffs 2" text,
"Copa M\u00e9xico" text,
"CONCACAF" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "Playoffs 1" FROM table_52985 WHERE "Season" = '2004-05' | wikisql |
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP_DOB datetime
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),... | SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE ORDER BY COUNT(PROF_OFFICE) | nvbench |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABL... | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offe... | advising |
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 jybgb WHERE jybgb.JZLSH = '18286029694' AND NOT jybgb.KSMC LIKE '%产后%' | css |
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE < 9) | css |
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stoc... | SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_23475 (
"#" real,
"Title" text,
"Maneater" text,
"Television Premiere" text,
"DVD release" text,
"Writer" text,
"Director" text,
"Producer" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many dvd releases where dir... | SELECT COUNT("DVD release") FROM table_23475 WHERE "Director" = 'David DeCoteau' | wikisql |
CREATE TABLE table_28177 (
"Episode" real,
"Reward" text,
"Leader Battle" text,
"Immunity" text,
"Individual Immunity" text,
"Eliminated" text,
"Vote" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the left day 9 fini... | SELECT "Eliminated" FROM table_28177 WHERE "Finish" = 'Left Day 9' | wikisql |
CREATE TABLE table_40658 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what week were there 26,243 in attendance on September 21, 1969?
| SELECT COUNT("Week") FROM table_40658 WHERE "Date" = 'september 21, 1969' AND "Attendance" < '26,243' | wikisql |
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 patients.dob FROM patients WHERE patients.subject_id = 15125 | mimic_iii |
CREATE TABLE table_45829 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent before week 12, on November 11, 1990?
| SELECT "Opponent" FROM table_45829 WHERE "Week" < '12' AND "Date" = 'november 11, 1990' | wikisql |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE club (
clubid number,
clubname text,
clubdes... | SELECT AVG(t3.age) 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" | spider |
CREATE TABLE table_name_71 (
player VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Cincinnati College player?
| SELECT player FROM table_name_71 WHERE college = "cincinnati" | sql_create_context |
CREATE TABLE table_16972 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title of the episode wi... | SELECT "Title" FROM table_16972 WHERE "Production code" = '311' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_name_30 (
rank VARCHAR,
notes VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the rank if the time was 5:54.57 and FB in notes?
| SELECT rank FROM table_name_30 WHERE notes = "fb" AND time = "5:54.57" | sql_create_context |
CREATE TABLE table_43866 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 2nd Leg, when Team 1 is 'H'?
| SELECT "2nd leg" FROM table_43866 WHERE "Team 1" = 'h' | wikisql |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'NEUROSCI' AND semester.semester = 'Spring' | advising |
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.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Price | nvbench |
CREATE TABLE table_2008069_2 (
pinyin VARCHAR,
uyghur___k̢ona_yezik̢__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the pinyin for
| SELECT pinyin FROM table_2008069_2 WHERE uyghur___k̢ona_yezik̢__ = "تىزناپ" | sql_create_context |
CREATE TABLE table_name_37 (
record VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record of Jeremija Sanders' opponent?
| SELECT record FROM table_name_37 WHERE opponent = "jeremija sanders" | 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 t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '41726844' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 1130.37) | css |
CREATE TABLE table_51704 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the grid total for david coulthard with over 45 laps?
| SELECT COUNT("Grid") FROM table_51704 WHERE "Driver" = 'david coulthard' AND "Laps" > '45' | wikisql |
CREATE TABLE table_15255 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "Club" FROM table_15255 WHERE "Drawn" = '1' AND "Lost" = '11' AND "Try bonus" = '7' | wikisql |
CREATE TABLE table_57148 (
"NAME ATHLETE" text,
"FINAL" text,
"LANE" real,
"SEMI" text,
"HEAT" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the final time for the swimmer on lane 4?
| SELECT "FINAL" FROM table_57148 WHERE "LANE" = '4' | wikisql |
CREATE TABLE table_263 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the tournament on Jul 11?
| SELECT "Tournament" FROM table_263 WHERE "Date" = 'Jul 11' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_co... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 <= 5) | mimic_iii |
CREATE TABLE Player_Attributes (
preferred_foot VARCHAR,
overall_rating INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average rating for right-footed players and left-footed players?
| SELECT preferred_foot, AVG(overall_rating) FROM Player_Attributes GROUP BY preferred_foot | sql_create_context |
CREATE TABLE table_name_4 (
pick__number VARCHAR,
round VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Picks have a Round larger than 8, and a College of fresno state?
| SELECT COUNT(pick__number) FROM table_name_4 WHERE round > 8 AND college = "fresno state" | sql_create_context |
CREATE TABLE table_20487 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of week 2?
| SELECT "Result" FROM table_20487 WHERE "Week" = '2' | 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 cost (
costid number,
uniquepid text,... | SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-165214' AND patient.hospitaldischargetime IS NULL) | eicu |
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.days_stay > "29" AND prescriptions.drug = "Miconazole Powder 2%" | mimicsql_data |
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3816229' AND t_kc21.IN_DIAG_DIS_NM = '急性根尖周炎') | css |
CREATE TABLE table_23233 (
"Office" text,
"Branch" text,
"Location" text,
"Elected" real,
"Term began" text,
"Term ended" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What location was the congressional service of which the term ended in Janua... | SELECT "Location" FROM table_23233 WHERE "Term ended" = 'January 3, 2011' | wikisql |
CREATE TABLE table_name_51 (
wins INTEGER,
draws INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the number of wins for teams with more than 0 draws?
| SELECT SUM(wins) FROM table_name_51 WHERE draws > 0 | sql_create_context |
CREATE TABLE company (
name VARCHAR,
Sales_in_Billion INTEGER,
Profits_in_Billion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- list the names of the companies with more than 200 sales in the descending order of sales and profits.
| SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion, Profits_in_Billion DESC | sql_create_context |
CREATE TABLE Ref_Detention_Type (
detention_type_description VARCHAR,
detention_type_code VARCHAR
)
CREATE TABLE Detention (
detention_type_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the code and description of the least frequent deten... | SELECT T1.detention_type_code, T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code = T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY COUNT(*) LIMIT 1 | sql_create_context |
CREATE TABLE table_62465 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sokn)" text,
"Church Name" text,
"Year Built" text,
"Location of the Church" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the church that is located in eikefj... | SELECT "Church Name" FROM table_62465 WHERE "Location of the Church" = 'eikefjord' | wikisql |
CREATE TABLE table_57459 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team did team carlton play while away?
| SELECT "Home team" FROM table_57459 WHERE "Away team" = 'carlton' | wikisql |
CREATE TABLE table_19838 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT "Avg. Finish" FROM table_19838 WHERE "Avg. Start" = '18.4' | wikisql |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
... | SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY SUM(meter_100) | nvbench |
CREATE TABLE table_204_121 (
id number,
"year" text,
"game" text,
"developer" text,
"setting" text,
"platform" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many games were produced in 1984 ?
| SELECT COUNT("game") FROM table_204_121 WHERE "year" = 1984 | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.label = "Lymphs" | mimicsql_data |
CREATE TABLE table_name_22 (
team VARCHAR,
start VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team has 33 starts?
| SELECT team FROM table_name_22 WHERE start = "33" | 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.MAIN_COND_DES FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '88548403439' | css |
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
-- Using valid SQLite, answer... | SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY COUNT(Location) DESC | nvbench |
CREATE TABLE roller_coaster (
Name VARCHAR,
Country_ID VARCHAR
)
CREATE TABLE country (
Name VARCHAR,
Country_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the names of roller coasters and names of country they are in.
| SELECT T2.Name, T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID | sql_create_context |
CREATE TABLE table_17310 (
"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.
-- Which ... | SELECT "Date" FROM table_17310 WHERE "Team" = '@ Memphis' | 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 IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '秦浩然' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 216.54) | css |
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARC... | SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID | nvbench |
CREATE TABLE membership_register_branch (
Member_ID int,
Branch_ID text,
Register_Year text
)
CREATE TABLE branch (
Branch_ID int,
Name text,
Open_year text,
Address_road text,
City text,
membership_amount text
)
CREATE TABLE purchase (
Member_ID int,
Branch_ID text,
Ye... | SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE Customer (
CustomerId integer,
FirstName varchar(40),
LastName varchar(20),
Company varchar(80),
Address varchar(70),
City varchar(40),
State varchar(40),
Country varchar(40),
PostalCode varchar(10),
Phone varchar(24),
Fax varchar(24),
Email varchar(60),
... | SELECT T1.FirstName, T1.SupportRepId FROM Customer AS T1 JOIN Employee AS T2 ON T1.SupportRepId = T2.EmployeeId | nvbench |
CREATE TABLE table_73093 (
"Election" real,
"Leader" text,
"# of candidates" real,
"# of seats to be won" real,
"# of seats won" real,
"# of total votes" real,
"% of popular vote" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the numbe... | SELECT "# of seats to be won" FROM table_73093 WHERE "% of popular vote" = '6.88%' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text... | SELECT mzjzjlb.JZLSH 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_info_mzj... | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'intra... | eicu |
CREATE TABLE table_46038 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the silver for rank 1 with less than 2 bronze?
| SELECT MIN("Silver") FROM table_46038 WHERE "Rank" = '1' AND "Bronze" < '2' | wikisql |
CREATE TABLE table_14597 (
"Perfect stem" text,
"Future stem" text,
"Imperfect stem" text,
"Short stem" text,
"Meaning" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the short stem for the word that has a perfect stem of poztu?
| SELECT "Short stem" FROM table_14597 WHERE "Perfect stem" = 'poztu' | wikisql |
CREATE TABLE table_1013129_1 (
nationality VARCHAR,
nhl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The nhl team new york islanders is what nationality?
| SELECT nationality FROM table_1013129_1 WHERE nhl_team = "New York Islanders" | sql_create_context |
CREATE TABLE table_36313 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game that had a loss of Johnson (9-8)?
| SELECT "Date" FROM table_36313 WHERE "Loss" = 'johnson (9-8)' | wikisql |
CREATE TABLE office_locations (
building_id number,
company_id number,
move_in_year number
)
CREATE TABLE buildings (
id number,
name text,
city text,
height number,
stories number,
status text
)
CREATE TABLE companies (
id number,
name text,
headquarters text,
indu... | SELECT industry, COUNT(*) FROM companies GROUP BY industry | spider |
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
College text
)
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE playe... | SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Pick_Number DESC | nvbench |
CREATE TABLE table_32085 (
"Original week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the sum of original week for september 16, 1982
| SELECT SUM("Original week") FROM table_32085 WHERE "Date" = 'september 16, 1982' | wikisql |
CREATE TABLE table_33063 (
"Season" text,
"Group I" text,
"Group II" text,
"Group III" text,
"Group IV" text,
"Group V" text,
"Group VI" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won Group VI, when Group 1 was won by deportivo, grou... | SELECT "Group VI" FROM table_33063 WHERE "Group I" = 'deportivo' AND "Group IV" = 'sevilla' AND "Group III" = 'valencia' | wikisql |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour... | advising |
CREATE TABLE table_78786 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog Nr." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date has Total Holocaust records in the ed Remaster cassette format?
| SELECT "Date" FROM table_78786 WHERE "Label" = 'total holocaust records' AND "Format" = 'ed remaster cassette' | 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 prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Gastroview (Diatrizoate Meglumine & Sodium)" | mimicsql_data |
CREATE TABLE table_38020 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of laps for the honda vehicle, with a grid of 13?
| SELECT "Laps" FROM table_38020 WHERE "Constructor" = 'honda' AND "Grid" = '13' | wikisql |
CREATE TABLE table_63913 (
"Year" text,
"Total Support and Revenue" text,
"Total Expenses" text,
"Increase in Net Assets" text,
"Net Assets at End of Year" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With the net assets at end of year of $8,231,7... | SELECT "Increase in Net Assets" FROM table_63913 WHERE "Net Assets at End of Year" = '$8,231,767' | wikisql |
CREATE TABLE table_4543 (
"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.
-- Where did Hawthorn play as home team?
| SELECT "Venue" FROM table_4543 WHERE "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_44233 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Pick has a Round larger than 1, a School/Club Team of alcorn state, and a Position of defen... | SELECT SUM("Pick") FROM table_44233 WHERE "Round" > '1' AND "School/Club Team" = 'alcorn state' AND "Position" = 'defensive back' | wikisql |
CREATE TABLE table_26555737_1 (
director VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When nominee is the result who is the director?
| SELECT director FROM table_26555737_1 WHERE result = "Nominee" | sql_create_context |
CREATE TABLE table_name_10 (
h_a_n VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is H/A/N, when Score is 104-109?
| SELECT h_a_n FROM table_name_10 WHERE score = "104-109" | sql_create_context |
CREATE TABLE table_68296 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the qualification for rank of 29 in 1957?
| SELECT "Qual" FROM table_68296 WHERE "Rank" = '29' AND "Year" = '1957' | wikisql |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Earl Werner%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = c... | advising |
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.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price | nvbench |
CREATE TABLE table_14082 (
"Year" real,
"Category" text,
"Nominee(s)" text,
"Episode" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average year with nominated result?
| SELECT AVG("Year") FROM table_14082 WHERE "Result" = 'nominated' | wikisql |
CREATE TABLE table_57866 (
"Name" text,
"Position" text,
"Height" text,
"Weight(lbs)" real,
"Born" text,
"College" text,
"Drafted" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which height has a College of wyoming, and a Name of guy frazie... | SELECT "Height" FROM table_57866 WHERE "College" = 'wyoming' AND "Name" = 'guy frazier' | wikisql |
CREATE TABLE table_59445 (
"Party" text,
"% votes" real,
"% change" real,
"Seats" real,
"Change" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the fewest seats with a -3.7% change and more than 4.7% votes?
| SELECT MIN("Seats") FROM table_59445 WHERE "% change" = '-3.7' AND "% votes" > '4.7' | wikisql |
CREATE TABLE table_2665085_1 (
length__ft_ VARCHAR,
speed__mph_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the length of the coaster with the unknown speed
| SELECT length__ft_ FROM table_2665085_1 WHERE speed__mph_ = "unknown" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb 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 AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGD... | css |
CREATE TABLE table_62043 (
"Tie no" real,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the sum of attendance when banbury united is the away team and tie no is over 102?
| SELECT SUM("Attendance") FROM table_62043 WHERE "Away team" = 'banbury united' AND "Tie no" > '102' | wikisql |
CREATE TABLE table_204_209 (
id number,
"released" text,
"title" text,
"label" text,
"number" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many albums did pearl django release in 1999 ?
| SELECT COUNT("title") FROM table_204_209 WHERE "released" = 1999 | squall |
CREATE TABLE table_63779 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number played with 1 drawn, and less than 7 points?
| SELECT COUNT("Played") FROM table_63779 WHERE "Drawn" = '1' AND "Points" < '7' | wikisql |
CREATE TABLE table_16530 (
"Year" real,
"Numer of Jamaicans granted British citizenship" real,
"Naturalisation by residence" real,
"Naturalisation by marriage" real,
"Registration of a minor child" real,
"Registration by other means" real
)
-- Using valid SQLite, answer the following questions... | SELECT "Naturalisation by marriage" FROM table_16530 WHERE "Numer of Jamaicans granted British citizenship" = '3165' | wikisql |
CREATE TABLE player (
player_id text,
birth_year text,
birth_month text,
birth_day text,
birth_country text,
birth_state text,
birth_city text,
death_year text,
death_month text,
death_day text,
death_country text,
death_state text,
death_city text,
name_first tex... | SELECT DISTINCT yearid FROM hall_of_fame WHERE needed_note <> "" | thehistoryofbaseball |
CREATE TABLE table_11764007_2 (
member VARCHAR,
week_sent_to_third_island VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was sent to the third island in week 1?
| SELECT member FROM table_11764007_2 WHERE week_sent_to_third_island = "1" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT * FROM Posts WHERE Id = 177470 | sede |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TAB... | SELECT DISTINCT credits FROM course WHERE department = 'EECS' AND number = 699 | advising |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.