instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_9 (
club VARCHAR,
drawn VARCHAR,
try_bonus VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Club, when Drawn is '0', and when Try Bonus is '5'?
| SELECT club FROM table_name_9 WHERE drawn = "0" AND try_bonus = "5" | sql_create_context |
CREATE TABLE table_name_52 (
champion VARCHAR,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the champion for christopher miles runner-up
| SELECT champion FROM table_name_52 WHERE runner_up = "christopher miles" | sql_create_context |
CREATE TABLE table_22848 (
"Rank" real,
"London Borough" text,
"Indian Population" real,
"Pakistani Population" real,
"Bangladeshi Population" real,
"Chinese Population" real,
"Other Asian Population" real,
"Total Asian Population" real
)
-- Using valid SQLite, answer the following que... | SELECT "Chinese Population" FROM table_22848 WHERE "Pakistani Population" = '26347' | wikisql |
CREATE TABLE table_name_74 (
team_1 VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the team one for preliminary final
| SELECT team_1 FROM table_name_74 WHERE name = "preliminary final" | sql_create_context |
CREATE TABLE table_14990 (
"LT Nos" text,
"Year" real,
"Bldr" text,
"Type" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Bldr of mcw&f, and a Year smaller than 1927, and a LT Nos of 9820-9821 has what type?
| SELECT "Type" FROM table_14990 WHERE "Bldr" = 'mcw&f' AND "Year" < '1927' AND "LT Nos" = '9820-9821' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "17" AND prescriptions.drug = "Sulfameth/Trimethoprim DS" | mimicsql_data |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME DESC | nvbench |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId... | SELECT DisplayName, AboutMe FROM Users WHERE AboutMe LIKE '%evil%' | sede |
CREATE TABLE table_name_1 (
circuit VARCHAR,
fastest_lap VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the circuit when Phil Hill has the fastest lap?
| SELECT circuit FROM table_name_1 WHERE fastest_lap = "phil hill" | sql_create_context |
CREATE TABLE table_name_35 (
high_rebounds VARCHAR,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the highest rebounds of the game with A. Johnson (6) as the highest assist?
| SELECT high_rebounds FROM table_name_35 WHERE high_assists = "a. johnson (6)" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
ic... | SELECT t3.labname FROM (SELECT t2.labname, 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 = 'thrombolytics' AN... | eicu |
CREATE TABLE table_train_129 (
"id" int,
"cerebral_neoplasia" bool,
"gender" string,
"mini_mental_state_examination_mmse" int,
"multiple_lacunar_infarcts" bool,
"neurodegenerative_disease" bool,
"mri_abnormality" bool,
"nervous_system_functioning" bool,
"head_injury" bool,
"serio... | SELECT * FROM table_train_129 WHERE neurodegenerative_disease = 1 OR serious_neurological_disorders = 1 AND ad = 0 OR lewy_body_dementia = 1 OR fronto_temporal_dementia = 1 OR parkinson_disease = 1 OR huntington_disease = 1 OR major_cortical_stroke = 1 OR head_injury = 1 OR cerebral_neoplasia = 1 OR systemic_medical_di... | criteria2sql |
CREATE TABLE table_name_17 (
time_retired VARCHAR,
laps VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the retired time on someone who had 43 laps on a grip of 18?
| SELECT time_retired FROM table_name_17 WHERE laps = 43 AND grid = 18 | sql_create_context |
CREATE TABLE table_43600 (
"Name" text,
"Hanzi" text,
"Hanyu Pinyin" text,
"Population (2004 est.)" text,
"Area (km\u00b2)" text,
"Density (/km\u00b2)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Hanyu Pinyin is labeled rural?
| SELECT "Hanyu Pinyin" FROM table_43600 WHERE "Name" = 'rural' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_203_400 (
id number,
"district" text,
"vacator" text,
"reason for change" text,
"successor" text,
"date successor\nseated" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which district is listed last on this chart ?
| SELECT "district" FROM table_203_400 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_2114308_1 (
broadcast_date VARCHAR,
viewers__in_millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the broadcast date of 6.9 million viewers
| SELECT broadcast_date FROM table_2114308_1 WHERE viewers__in_millions_ = "6.9" | sql_create_context |
CREATE TABLE table_name_82 (
feminine_ōn_stems VARCHAR,
feminine_ō_stems VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ending does siangu get for n?
| SELECT feminine_ōn_stems FROM table_name_82 WHERE feminine_ō_stems = "siangu" | sql_create_context |
CREATE TABLE table_30672 (
"Couple" text,
"Style" text,
"Music" text,
"Trine Dehli Cleve" real,
"Tor Fl\u00f8ysvik" real,
"Karianne Gulliksen" real,
"Christer Tornell" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is ... | SELECT MAX("Total") FROM table_30672 WHERE "Music" = ' YMCA "— Village People' | wikisql |
CREATE TABLE table_204_463 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long after 2008 did it take for division 4 to qual... | SELECT "year" - 2008 FROM table_204_463 WHERE "playoffs" <> 'did not qualify' AND "year" > 2008 | squall |
CREATE TABLE table_name_7 (
runners_up VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the runners-up for the FC Viktoria Plze club?
| SELECT runners_up FROM table_name_7 WHERE club = "fc viktoria plzeň" | sql_create_context |
CREATE TABLE table_64901 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" real,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
)
-- Using valid SQLite, answer the following questi... | SELECT AVG("League Goals") FROM table_64901 WHERE "Total Apps" = '2 (1)' | wikisql |
CREATE TABLE table_69431 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 9:30 feature with la porte des toiles at 8:30?
| SELECT "9:30" FROM table_69431 WHERE "8:30" = 'la porte des étoiles' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE 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 lab.label = "Triiodothyronine (T3)" | mimicsql_data |
CREATE TABLE table_name_34 (
killed INTEGER,
perpetrator VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many kills did basobas, florentino have?
| SELECT MAX(killed) FROM table_name_34 WHERE perpetrator = "basobas, florentino" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-26564' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho... | eicu |
CREATE TABLE table_66780 (
"Outcome" text,
"Date" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent for the winner outcome on a hard surface on August 27, 2011?
| SELECT "Opponent" FROM table_66780 WHERE "Outcome" = 'winner' AND "Surface" = 'hard' AND "Date" = 'august 27, 2011' | wikisql |
CREATE TABLE table_47932 (
"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 day was the surface clay and the score 6 1, 6 4?
| SELECT "Date" FROM table_47932 WHERE "Surface" = 'clay' AND "Score" = '6–1, 6–4' | wikisql |
CREATE TABLE table_75486 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Bronze is the highest one that has a Rank larger than 1, and a Nation of dominican rep... | SELECT MAX("Bronze") FROM table_75486 WHERE "Rank" > '1' AND "Nation" = 'dominican republic' AND "Total" > '4' | wikisql |
CREATE TABLE table_76425 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Record on July 12?
| SELECT "Record" FROM table_76425 WHERE "Date" = 'july 12' | wikisql |
CREATE TABLE table (
r VARCHAR,
coppa_italia INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of r for coppa italia larger than 1.0
| SELECT COUNT(r) FROM table WHERE coppa_italia > 1.0 | sql_create_context |
CREATE TABLE table_11970261_2 (
interview VARCHAR,
swimsuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the interview with swimsuit being 9.140
| SELECT interview FROM table_11970261_2 WHERE swimsuit = "9.140" | 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 zyjzjlb (
YLJGDM text,
JZLSH ... | SELECT ZYBMLX, ZYZDBM, ZYZDMC FROM zyjzjlb WHERE JZLSH = '92564825799' | css |
CREATE TABLE table_24066 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is he archive for the episode with a run time of 24:05?
| SELECT "Archive" FROM table_24066 WHERE "Run time" = '24:05' | wikisql |
CREATE TABLE table_name_25 (
record VARCHAR,
opponent VARCHAR,
points VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the record for a game past 44 against the Dallas Stars with more than 54 points?
| SELECT record FROM table_name_25 WHERE points > 54 AND game > 44 AND opponent = "dallas stars" | sql_create_context |
CREATE TABLE table_31458 (
"Station" text,
"Metlink code" text,
"Line(s)" text,
"Service(s)" text,
"Serves" text,
"km from Wellington" text,
"Fare zone(s)" text,
"Opened" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the metlink... | SELECT "Metlink code" FROM table_31458 WHERE "Opened" = '1908' | wikisql |
CREATE TABLE table_18283 (
"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.
-- To which party does Robert W. Edgar belong?
| SELECT "Party" FROM table_18283 WHERE "Incumbent" = 'Robert W. Edgar' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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... | mimic_iii |
CREATE TABLE table_20963 (
"Wicket" text,
"Runs" real,
"Batting partners" text,
"Batting team" text,
"Fielding team" text,
"Venue" text,
"Season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the batting partners for the 1997 season... | SELECT "Batting partners" FROM table_20963 WHERE "Season" = '1997' | wikisql |
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 * FROM t_kc21 WHERE t_kc21.PERSON_ID = '97484967' AND t_kc21.MED_SER_ORG_NO = '0560668' AND t_kc21.MED_ORG_DEPT_NM LIKE '%急诊%' | css |
CREATE TABLE table_name_29 (
visitor VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the visitor in the game that had Ottawa as the home team?
| SELECT visitor FROM table_name_29 WHERE home = "ottawa" | sql_create_context |
CREATE TABLE table_5103 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Played have a Lost smaller than 3, and ... | SELECT COUNT("Played") FROM table_5103 WHERE "Lost" < '3' AND "Difference" = '6' AND "Points" > '6' | wikisql |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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 n... | 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 = '96787952' AND hz_info.YLJGDM = '6798205' AND mzjzjlb.JZKSMC LIKE '%手外科%' | css |
CREATE TABLE table_58748 (
"South West DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many byes did they have against smaller than 1544, 13 wins, and draws larger th... | SELECT COUNT("Byes") FROM table_58748 WHERE "Against" < '1544' AND "Wins" = '13' AND "Draws" > '0' | wikisql |
CREATE TABLE table_68896 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Trofeo Fast Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Points classification" FROM table_68896 WHERE "Stage" = '13' | wikisql |
CREATE TABLE table_73902 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many categories fall under the category of britons?
| SELECT COUNT("Type") FROM table_73902 WHERE "Nickname" = 'Britons' | 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.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY COUNT(T1.Name) | nvbench |
CREATE TABLE table_203_764 (
id number,
"name" text,
"date" number,
"nation" text,
"displacement" text,
"speed" text,
"number" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many tons of displacement does type b have ... | SELECT "displacement" FROM table_203_764 WHERE "name" = 'type b' | squall |
CREATE TABLE table_34980 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For an ICAO of VCCT, what is the IATA?
| SELECT "IATA" FROM table_34980 WHERE "ICAO" = 'vcct' | wikisql |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
-- Using valid SQLite, answer the following questions fo... | SELECT Type, COUNT(*) FROM ship GROUP BY Type | nvbench |
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 WHERE demographic.admission_type = "URGENT" AND demographic.dob_year < "1821" | mimicsql_data |
CREATE TABLE table_name_85 (
writer VARCHAR,
producer_executive_producer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which writer had a producer DKA, JL, AS?
| SELECT writer FROM table_name_85 WHERE producer_executive_producer = "dka, jl, as" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
... | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_name_37 (
score VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the tournament with younes el aynaoui as the opponent?
| SELECT score FROM table_name_37 WHERE opponent = "younes el aynaoui" | sql_create_context |
CREATE TABLE table_80148 (
"Designation" text,
"Constellation" text,
"Date sent" text,
"Arrival date" text,
"Message" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is Hip 4872?
| SELECT "Constellation" FROM table_80148 WHERE "Designation" = 'hip 4872' | wikisql |
CREATE TABLE hall_of_fame (
player_id TEXT,
yearid INTEGER,
votedby TEXT,
ballots NUMERIC,
needed NUMERIC,
votes NUMERIC,
inducted TEXT,
category TEXT,
needed_note TEXT
)
CREATE TABLE manager_award_vote (
award_id TEXT,
year INTEGER,
league_id TEXT,
player_id TEXT,
... | SELECT year, AVG(attendance) FROM home_game GROUP BY year ORDER BY year | nvbench |
CREATE TABLE item (
i_id number,
title text
)
CREATE TABLE review (
a_id number,
u_id number,
i_id number,
rating number,
rank number
)
CREATE TABLE useracct (
u_id number,
name text
)
CREATE TABLE trust (
source_u_id number,
target_u_id number,
trust number
)
-- Usi... | SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5 | spider |
CREATE TABLE table_name_16 (
result VARCHAR,
week VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the result for the week higher than 7 on november 4, 1979?
| SELECT result FROM table_name_16 WHERE week > 7 AND date = "november 4, 1979" | sql_create_context |
CREATE TABLE table_66061 (
"Chassis code" text,
"Model Years" text,
"Model" text,
"Engine" text,
"No. built" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the years that has a chassis code of W116.025 and number built was more than 150,593?
| SELECT "Model Years" FROM table_66061 WHERE "No. built" > '150,593' AND "Chassis code" = 'w116.025' | wikisql |
CREATE TABLE table_name_46 (
date_of_departure VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Brendan Rodgers depart his position?
| SELECT date_of_departure FROM table_name_46 WHERE name = "brendan rodgers" | sql_create_context |
CREATE TABLE table_43816 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event had a win, record of 8-1 and n/a round?
| SELECT "Event" FROM table_43816 WHERE "Res." = 'win' AND "Round" = 'n/a' AND "Record" = '8-1' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 88079 AND admissions.admission_location = 'phys referral/normal deli' AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_36 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the score for december 5
| SELECT score FROM table_name_36 WHERE date = "december 5" | sql_create_context |
CREATE TABLE table_5505 (
"Name" text,
"Lifespan" text,
"Country" text,
"Wins" real,
"Majors" real,
"Winning span" text,
"Span (years)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What lifespan has a majors greater than 1, and fuzzy zoell... | SELECT "Lifespan" FROM table_5505 WHERE "Majors" > '1' AND "Name" = 'fuzzy zoeller' | wikisql |
CREATE TABLE table_67614 (
"Year" real,
"Series title" text,
"Chinese title" text,
"Role" text,
"Channel" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The highest year for the series titled dragon laws ii: kidnapped is what?
| SELECT MAX("Year") FROM table_67614 WHERE "Series title" = 'dragon laws ii: kidnapped' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40)... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC | nvbench |
CREATE TABLE table_name_97 (
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What competition was held on the date 6/7/03
| SELECT competition FROM table_name_97 WHERE date = "6/7/03" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRG... | SELECT jybgb.BBDM, jybgb.BBMC, jybgb.BBZT FROM jybgb WHERE jybgb.BGDH = '14182284037' | css |
CREATE TABLE medicine_enzyme_interaction (
enzyme_id number,
medicine_id number,
interaction_type text
)
CREATE TABLE enzyme (
id number,
name text,
location text,
product text,
chromosome text,
omim number,
porphyria text
)
CREATE TABLE medicine (
id number,
name text,... | SELECT T1.id, T1.name, T1.fda_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC | spider |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT | nvbench |
CREATE TABLE table_13907 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time has a Set 1 of 18 25?
| SELECT "Time" FROM table_13907 WHERE "Set 1" = '18–25' | wikisql |
CREATE TABLE table_59983 (
"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.
-- How many people on average attended when Eastwood Town was the away team, and the tie number was ... | SELECT AVG("Attendance") FROM table_59983 WHERE "Tie no" < '8' AND "Away team" = 'eastwood town' | wikisql |
CREATE TABLE table_name_3 (
casualties VARCHAR,
intensity VARCHAR,
epicenter VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many casualties were in the earthquake with an unknown intensity and an epicenter in the bou ra province?
| SELECT casualties FROM table_name_3 WHERE intensity = "unknown" AND epicenter = "bouïra province" | sql_create_context |
CREATE TABLE table_name_26 (
mountains_classification VARCHAR,
points_classification VARCHAR,
general_classification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the mountains classification when the points classification is Alessandro Petacchi ... | SELECT mountains_classification FROM table_name_26 WHERE points_classification = "alessandro petacchi" AND general_classification = "danilo di luca" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT MED_EXP_DET_ID FROM t_kc22 WHERE MED_CLINIC_ID = '83496462018' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2') | css |
CREATE TABLE table_name_6 (
team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the team leading on August 17?
| SELECT team FROM table_name_6 WHERE date = "august 17" | sql_create_context |
CREATE TABLE table_14559 (
"Opponent" text,
"OVERALL" text,
"HOME" text,
"AWAY" text,
"PLYFF" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Overall has a playoff record of (0-1) and an away record of (1-1)?
| SELECT "OVERALL" FROM table_14559 WHERE "PLYFF" = '(0-1)' AND "AWAY" = '(1-1)' | wikisql |
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
... | SELECT county_name FROM county ORDER BY population LIMIT 3 | spider |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
... | (SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '蒋夏彤' AND jyb... | css |
CREATE TABLE TRACK (
GenreId VARCHAR
)
CREATE TABLE GENRE (
GenreId VARCHAR,
Name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the duration of the longest and shortest pop tracks in milliseconds?
| SELECT MAX(Milliseconds), MIN(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Pop" | sql_create_context |
CREATE TABLE table_name_27 (
time VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long was his fight against kim kyoung-suk?
| SELECT time FROM table_name_27 WHERE opponent = "kim kyoung-suk" | sql_create_context |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "25013" | mimicsql_data |
CREATE TABLE table_2562572_56 (
settlement VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the settlement destiny in Aleksandrovo?
| SELECT settlement AS destiny FROM table_2562572_56 WHERE settlement = "Aleksandrovo" | 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_ID = '02519154' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6518.86) | css |
CREATE TABLE table_name_89 (
finish VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the finish for 1992?
| SELECT finish FROM table_name_89 WHERE year = 1992 | sql_create_context |
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 ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC | 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 COUNT(mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX ... | css |
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjl... | css |
CREATE TABLE table_42571 (
"Match" real,
"Date" text,
"Home/Away" text,
"Opponent team" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest match when the away opponent was Dalian Shide Siwu?
| SELECT MAX("Match") FROM table_42571 WHERE "Opponent team" = 'dalian shide siwu' AND "Home/Away" = 'away' | wikisql |
CREATE TABLE fgwyjzb (
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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.IN_DIAG_DIS_NM = '维生素B缺乏病' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.IN_DIAG_... | css |
CREATE TABLE table_17650725_1 (
internal_transfers INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least internal transfers
| SELECT MIN(internal_transfers) FROM table_17650725_1 | sql_create_context |
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
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)
)
CREA... | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_Details DESC | nvbench |
CREATE TABLE table_13093 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Whate place has 18 points with lost less t... | SELECT COUNT("Place") FROM table_13093 WHERE "Points" = '18' AND "Lost" < '8' | wikisql |
CREATE TABLE Products (
product_id INTEGER,
product_details VARCHAR(255)
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_address_from DATETIME,
address_type VARCHAR(15),
date_address_to DATETIME
)
CREATE TABLE Customer_Contact_Channels (
customer_id IN... | SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' ORDER BY COUNT(active_from_date) DESC | nvbench |
CREATE TABLE country (
country_id number,
country_name text,
capital text,
official_native_language text
)
CREATE TABLE player (
player_id number,
player text,
years_played text,
total_wl text,
singles_wl text,
doubles_wl text,
team number
)
CREATE TABLE team (
team_id ... | SELECT college FROM match_season GROUP BY college HAVING COUNT(*) >= 2 ORDER BY college DESC | spider |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51248" | mimicsql_data |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE fare_basis (
fare_basis_cod... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... | atis |
CREATE TABLE table_29147 (
"No. in total" text,
"No. in series" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number in series of the episode titled 'bea... | SELECT "No. in series" FROM table_29147 WHERE "Title" = 'Beauty and the Beast' | wikisql |
CREATE TABLE medicine (
name VARCHAR,
trade_name VARCHAR
)
CREATE TABLE enzyme (
id VARCHAR,
product VARCHAR
)
CREATE TABLE medicine_enzyme_interaction (
medicine_id VARCHAR,
enzyme_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the... | SELECT name, trade_name FROM medicine EXCEPT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX' | sql_create_context |
CREATE TABLE table_26202847_6 (
no VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On the date October 21, 2007, what is the No.?
| SELECT no FROM table_26202847_6 WHERE date = "October 21, 2007" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.