instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_79061 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the location when the opponent was Seattle Supers... | SELECT "Location/Attendance" FROM table_79061 WHERE "Opponent" = 'seattle supersonics' | wikisql |
CREATE TABLE gwyjzb (
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 COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8879930' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING MIN(gwyjzb.IN_HOSP_DAYS) > 10 UNION SELECT fgwyjzb.MED_ORG_DEPT_CD FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '8879930' GROUP BY fgwyjzb.MED_ORG_DEPT_CD HAVING MIN(fgwyjzb.IN_H... | css |
CREATE TABLE table_name_53 (
to_par INTEGER,
total INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the to par for the player with fewer than 148 total points?
| SELECT SUM(to_par) FROM table_name_53 WHERE total < 148 | sql_create_context |
CREATE TABLE table_56724 (
"Station" text,
"Engine Company" text,
"Ambulance" text,
"Address" text,
"Phone" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the phone number of the station located at 53 Dayton Road?
| SELECT "Phone" FROM table_56724 WHERE "Address" = '53 dayton road' | wikisql |
CREATE TABLE table_name_92 (
method VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the method of resolution when Mikhail Ilyukhin's record was 4-0?
| SELECT method FROM table_name_92 WHERE record = "4-0" | sql_create_context |
CREATE TABLE table_name_73 (
opponent_number VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent at the game attended by 45,000?
| SELECT opponent_number FROM table_name_73 WHERE attendance = "45,000" | sql_create_context |
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.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC | nvbench |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
... | SELECT DISTINCT paper.paperid FROM dataset, keyphrase, paper, paperdataset, paperkeyphrase, venue WHERE dataset.datasetname = 'Jeopardy! Questions' AND keyphrase.keyphrasename = 'Parsing' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = p... | scholar |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE table_name_39 (
date VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the release Date of Catalog RR 8655-2?
| SELECT date FROM table_name_39 WHERE catalog = "rr 8655-2" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "2" AND procedures.short_title = "Spinal tap" | mimicsql_data |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CRE... | SELECT 'site://users/' + CAST(u.Id AS VARCHAR) + '|' + CAST(u.DisplayName AS VARCHAR) AS "user", SUM(p.Score) AS "Total Score", u.Reputation, u.LastAccessDate FROM Users AS u, Posts AS p WHERE u.Reputation >= @Repmin AND u.Reputation <= @Repmax AND u.Id = p.OwnerUserId AND p.PostTypeId = 1 AND DATEDIFF(day, u.LastAcces... | sede |
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 demographic.age, lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime ... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | mimic_iii |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
chart... | SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3918)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'enfamilad... | mimic_iii |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '4645126' AND qtb.IN_HOSP_DATE BETWEEN '2003-02-07' AND '2010-03-27' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '4645126' AND gyb.IN_HOSP_DATE BETWEEN '2003-02-07' AND '2010-03-27' UNION SELECT COUNT(*) FROM zyb WHERE zyb.MED_SER_ORG_NO = '4645126' AND ... | css |
CREATE TABLE table_name_88 (
score VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Olin Dutra's score?
| SELECT score FROM table_name_88 WHERE player = "olin dutra" | sql_create_context |
CREATE TABLE table_name_86 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2004 value for the 2009 Grand slam tournaments?
| SELECT 2004 FROM table_name_86 WHERE 2009 = "grand slam tournaments" | sql_create_context |
CREATE TABLE table_36892 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least overall for tony baker
| SELECT MIN("Overall") FROM table_36892 WHERE "Name" = 'tony baker' | wikisql |
CREATE TABLE table_name_85 (
losses VARCHAR,
last_appearance VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Losses, when Last Appearance is 2003, and when Wins is greater than 2?
| SELECT COUNT(losses) FROM table_name_85 WHERE last_appearance = "2003" AND wins > 2 | sql_create_context |
CREATE TABLE table_name_28 (
brand VARCHAR,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Mark Henry's brand?
| SELECT brand FROM table_name_28 WHERE entrant = "mark henry" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-17204')) AND intakeoutput.celllabel = 'tube ... | eicu |
CREATE TABLE table_35980 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Top-25 has a Top-5 larger than 9, and Wins smaller than 11... | SELECT SUM("Top-25") FROM table_35980 WHERE "Top-5" > '9' AND "Wins" < '11' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15945) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... | mimic_iii |
CREATE TABLE fzzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.JZKSBM = '96274' AND zzmzjzjlb.JZKSRQ BETWEEN '2005-02-09' AND '2015-05-08' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZKSBM = '96274' AND fzzmzjzjlb.JZKSRQ BETWEEN '2005-02-09' AND '2015-05-08' | css |
CREATE TABLE table_22648 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Dolphins points" real,
"Opponents" real,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many dates do the dolphins have... | SELECT "Date" FROM table_22648 WHERE "Dolphins points" = '6' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
CREATE TABLE table_name_82 (
year INTEGER,
entrant VARCHAR,
engine VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which is the latest year that has an engine of Offenhauser l4, a chassis of Kurtis Kraft 500c, and the entrant of Feder... | SELECT MAX(year) FROM table_name_82 WHERE engine = "offenhauser l4" AND chassis = "kurtis kraft 500c" AND entrant = "federal engineering" | sql_create_context |
CREATE TABLE table_70261 (
"1-person dive" text,
"2-person dive" text,
"3-person dive" text,
"Surface" text,
"Cage dive" text,
"Seal/turtle decoy" text,
"Catch release" text,
"Attached camera" text,
"Remote camera" text
)
-- Using valid SQLite, answer the following questions for th... | SELECT "Surface" FROM table_70261 WHERE "Cage dive" = '2' | wikisql |
CREATE TABLE table_62736 (
"Name" text,
"Height" text,
"Weight" text,
"Spike" text,
"2008 club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which spike has a 2008 club Karava?
| SELECT "Spike" FROM table_62736 WHERE "2008 club" = 'karava' | wikisql |
CREATE TABLE table_15887683_1 (
content VARCHAR,
television_service VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the content of la7 television service?
| SELECT content FROM table_15887683_1 WHERE television_service = "LA7" | sql_create_context |
CREATE TABLE table_14070062_4 (
points_against VARCHAR,
points_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- was the the score when the tries was 743
| SELECT points_against FROM table_14070062_4 WHERE points_for = "743" | sql_create_context |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | SELECT Fname, AVG(Age) FROM Student WHERE Sex = 'F' GROUP BY Fname ORDER BY Fname DESC | nvbench |
CREATE TABLE table_name_28 (
player VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player is featured for 2001-2002?
| SELECT player FROM table_name_28 WHERE year = "2001-2002" | sql_create_context |
CREATE TABLE table_204_540 (
id number,
"name" text,
"town" text,
"deanery" text,
"vicariate" text,
"founded" number,
"original ethnic community" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the difference , in years between the f... | SELECT ABS((SELECT "founded" FROM table_204_540 WHERE "name" = 'st. agnes') - (SELECT "founded" FROM table_204_540 WHERE "name" = 'good shepherd')) | squall |
CREATE TABLE table_name_44 (
album VARCHAR,
composer_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Jimmie Lee Sloas was the composer for what album?
| SELECT album FROM table_name_44 WHERE composer_s_ = "jimmie lee sloas" | sql_create_context |
CREATE TABLE table_name_33 (
year INTEGER,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the top year with the Chassis ats hs1?
| SELECT MAX(year) FROM table_name_33 WHERE chassis = "ats hs1" | sql_create_context |
CREATE TABLE gymnast (
Total_Points VARCHAR,
Gymnast_ID VARCHAR
)
CREATE TABLE people (
People_ID VARCHAR,
Age VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total point count of the youngest gymnast?
| SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age LIMIT 1 | sql_create_context |
CREATE TABLE table_19834 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Combination classification" text,
"Team classification" text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT "Mountains classification" FROM table_19834 WHERE "Winner" = 'Alejandro Valverde' AND "Points classification" = 'Erik Zabel' | wikisql |
CREATE TABLE table_name_39 (
to_par VARCHAR,
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the to par at the T5 for the player with a score of 74-69-66=209?
| SELECT to_par FROM table_name_39 WHERE place = "t5" AND score = 74 - 69 - 66 = 209 | sql_create_context |
CREATE TABLE table_75946 (
"Round" text,
"Date" text,
"Home team" text,
"Score" text,
"Away team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which date was the score 0 - 0?
| SELECT "Date" FROM table_75946 WHERE "Score" = '0 - 0' | wikisql |
CREATE TABLE table_name_90 (
television_service VARCHAR,
content VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Television Service, when Content is Presentazione?
| SELECT television_service FROM table_name_90 WHERE content = "presentazione" | sql_create_context |
CREATE TABLE table_name_17 (
championship VARCHAR,
year VARCHAR,
winning_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which championship after 1985 had a winning score of 8 (68-72-69-71=280)?
| SELECT championship FROM table_name_17 WHERE year > 1985 AND winning_score = –8(68 - 72 - 69 - 71 = 280) | sql_create_context |
CREATE TABLE table_name_34 (
opponent VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has Attendances of 60,594?
| SELECT opponent FROM table_name_34 WHERE attendance = "60,594" | sql_create_context |
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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.long_title = "Depressive disorder, not elsewhere classified" | mimicsql_data |
CREATE TABLE table_15923 (
"Season" text,
"Network" text,
"Season premiere" text,
"Season finale" text,
"TV season" text,
"Ranking" text,
"Viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The season premiere aired on Sep... | SELECT COUNT("Network") FROM table_15923 WHERE "Season premiere" = 'September 11, 2000' | wikisql |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "UNKNOWN/NOT SPECIFIED" | mimicsql_data |
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id int,
color text,
name text
)
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_len... | SELECT T1.name, COUNT(T1.name) FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus' GROUP BY T1.name ORDER BY T1.name | nvbench |
CREATE TABLE table_2467150_2 (
model__list_ VARCHAR,
processor VARCHAR,
brand_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the value for model if processor is Kentsfield and brand name is Xeon?
| SELECT model__list_ FROM table_2467150_2 WHERE processor = "Kentsfield" AND brand_name = "Xeon" | sql_create_context |
CREATE TABLE table_27832075_2 (
us_viewers__millions_ VARCHAR,
series__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many million U.S. viewers wtched episode 69 of the series?
| SELECT us_viewers__millions_ FROM table_27832075_2 WHERE series__number = 69 | sql_create_context |
CREATE TABLE table_3352 (
"meas. num" real,
"passed" text,
"YES votes" real,
"NO votes" real,
"% YES" text,
"Const. Amd.?" text,
"type" text,
"description" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the % yes for yes votes for 7... | SELECT "% YES" FROM table_3352 WHERE "YES votes" = '78961' | wikisql |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
Pos... | SELECT t.TagName, COUNT(*) AS "total_questions", SUM(CASE WHEN p.AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS "no_accepted_answer", SUM(CASE WHEN p.AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) * 1.0 / COUNT(*) AS "%_unaccepted" FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id ... | sede |
CREATE TABLE table_name_97 (
tie_no VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Tie is from birmingham city?
| SELECT tie_no FROM table_name_97 WHERE home_team = "birmingham city" | 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 OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_ID = '02315348' AND IN_HOSP_DATE BETWEEN '2010-02-02' AND '2010-12-21' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_204_910 (
id number,
"rank" number,
"name" text,
"nationality" text,
"result" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many contestants were from thailand ?
| SELECT COUNT(*) FROM table_204_910 WHERE "nationality" = 'thailand' | squall |
CREATE TABLE table_36426 (
"NTFA Div 1" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of byes that are associated with 1 draw, 5 wins, and fewer tha... | SELECT SUM("Byes") FROM table_36426 WHERE "Draws" = '1' AND "Wins" = '5' AND "Losses" < '12' | wikisql |
CREATE TABLE table_36656 (
"Pick #" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the Player that shows the NHL team of ne... | SELECT "Player" FROM table_36656 WHERE "NHL team" = 'new york rangers' AND "Pick #" = '31' | wikisql |
CREATE TABLE table_20073 (
"Genus/Species" text,
"Common Name" text,
"Accession Number" text,
"Length" text,
"Similarity" text,
"Identity" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What identities do the genus/species arabidopsis thaliana h... | SELECT "Identity" FROM table_20073 WHERE "Genus/Species" = 'Arabidopsis thaliana' | wikisql |
CREATE TABLE products (
product_price INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the minimum, maximum, average price for all products.
| SELECT MIN(product_price), MAX(product_price), AVG(product_price) FROM products | sql_create_context |
CREATE TABLE table_29635868_1 (
object_date VARCHAR,
episode_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many object dates does episode #16 have?
| SELECT COUNT(object_date) FROM table_29635868_1 WHERE episode_number = 16 | sql_create_context |
CREATE TABLE mill (
architect_id int,
id int,
location text,
name text,
type text,
built_year int,
notes text
)
CREATE TABLE architect (
id text,
name text,
nationality text,
gender text
)
CREATE TABLE bridge (
architect_id int,
id int,
name text,
location t... | SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.name DESC | nvbench |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCAT... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID) DESC | nvbench |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
... | SELECT Id / 10000, COUNT(*) FROM Users GROUP BY Id / 10000 ORDER BY Id / 10000 | sede |
CREATE TABLE gwyjzb (
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 gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '86694077' UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '86694077' | css |
CREATE TABLE table_name_16 (
gold INTEGER,
rank VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the lowest gold for rank of 6 and total less than 2
| SELECT MIN(gold) FROM table_name_16 WHERE rank = "6" AND total < 2 | sql_create_context |
CREATE TABLE table_name_18 (
unami_delaware VARCHAR,
thomas__1698_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Unami Delaware value for a Thomas value of nacha?
| SELECT unami_delaware FROM table_name_18 WHERE thomas__1698_ = "nacha" | sql_create_context |
CREATE TABLE table_64457 (
"Kanji" text,
"Name" text,
"Builder" text,
"Laid down" text,
"Launched" text,
"Completed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was satsuki dd-27 completed?
| SELECT "Completed" FROM table_64457 WHERE "Name" = 'satsuki dd-27' | wikisql |
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 COUNT(*) FROM projects | spider |
CREATE TABLE table_name_91 (
date VARCHAR,
runner_s__up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has yani tseng as the runner (s)-up?
| SELECT date FROM table_name_91 WHERE runner_s__up = "yani tseng" | sql_create_context |
CREATE TABLE table_66483 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time was the race for the country of france?
| SELECT "Time" FROM table_66483 WHERE "Country" = 'france' | wikisql |
CREATE TABLE table_203_704 (
id number,
"rnd" number,
"date" text,
"location" text,
"laps" number,
"distance" text,
"time" text,
"speed\n(km/h)" number,
"winner" text,
"pole position" text,
"most leading laps" text,
"fastest race lap" text
)
-- Using valid SQLite, answe... | SELECT "location" FROM table_203_704 WHERE id = (SELECT id FROM table_203_704 WHERE "date" = 'march 22') - 1 | squall |
CREATE TABLE table_21118 (
"Rank" real,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" text,
"Profits (billion $)" text,
"Assets (billion $)" text,
"Market Value (billion $)" text
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT COUNT("Headquarters") FROM table_21118 WHERE "Company" = 'HSBC' | wikisql |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport... | 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, date_day, days, flight WHERE (((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 22 AND d... | atis |
CREATE TABLE table_75502 (
"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 attendance on September 28?
| SELECT MAX("Attendance") FROM table_75502 WHERE "Date" = 'september 28' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,... | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '褚芳芳' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2013-05-19') | css |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_na... | 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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEWARK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTL... | atis |
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.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer DESC | nvbench |
CREATE TABLE table_76289 (
"Position" real,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell... | SELECT SUM("Goals against") FROM table_76289 WHERE "Goals for" > '10' AND "Position" = '3' AND "Wins" < '6' | wikisql |
CREATE TABLE table_75224 (
"Sport" text,
"Record" text,
"Nation" text,
"Date" text,
"Time (sec.)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which nation finished with a time of 47.049?
| SELECT "Nation" FROM table_75224 WHERE "Time (sec.)" = '47.049' | wikisql |
CREATE TABLE table_name_67 (
played VARCHAR,
goals_for VARCHAR,
points VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of played when points of is 31-7, position is 16 and goals for is less than 35
| SELECT COUNT(played) FROM table_name_67 WHERE points = "31-7" AND position = 16 AND goals_for < 35 | sql_create_context |
CREATE TABLE table_name_13 (
total INTEGER,
bronze VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the lowest total when there's less than 16 bronze and more than 6 silver?
| SELECT MIN(total) FROM table_name_13 WHERE bronze < 16 AND silver > 6 | sql_create_context |
CREATE TABLE table_69966 (
"Date" text,
"Country" text,
"Name" text,
"Award" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the award type for all Lowe awards?
| SELECT "Award" FROM table_69966 WHERE "Name" = 'lowe' | wikisql |
CREATE TABLE table_27576 (
"School Year" text,
"Language" text,
"Science" text,
"Reading" text,
"Mathematics" text,
"Social Studies" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the reading score in the year the science score was 96.1... | SELECT "Reading" FROM table_27576 WHERE "Science" = '96.13' | wikisql |
CREATE TABLE table_35421 (
"Name" text,
"Innhabitants" real,
"Area" real,
"Mayor" text,
"Party" text,
"Municipal code" real,
"Language form" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Mayor is from the KRF Party?
| SELECT "Mayor" FROM table_35421 WHERE "Party" = 'krf' | wikisql |
CREATE TABLE table_203_510 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n(/mi2)" number,
"population\ndensity\n(/km2)" number,
"land area\n(mi2)" number,
"land area\n(km2)" number,
"water area\n(mi2)" number,
... | SELECT "township" FROM table_203_510 ORDER BY "population" LIMIT 1 | squall |
CREATE TABLE table_59742 (
"Short vowels" text,
"17th-c." text,
"American" text,
"British" text,
"Australian" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Australian sound is equivalent to e / /?
| SELECT "Australian" FROM table_59742 WHERE "Short vowels" = 'e /ɛ/' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Neutral, ACC_Percent FROM basketball_match | nvbench |
CREATE TABLE table_name_39 (
winning_score VARCHAR,
margin VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the winning score of the match with a margin of 3 strokes?
| SELECT winning_score FROM table_name_39 WHERE margin = "3 strokes" | sql_create_context |
CREATE TABLE table_73057 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Giants points" real,
"Opponents" real,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum number of opponen... | SELECT MIN("Opponents") FROM table_73057 | wikisql |
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 (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '5498370' GROUP BY MED_ORG_DEPT_CD HAVING AVG(IN_HOSP_DAYS) > 3) AS T | css |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
... | SELECT MAX(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-58944' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL GROUP... | eicu |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT mzjzjlb.YLJGDM 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 = '28448699' UNION SELECT wdmzjzjlb.YLJGDM FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmz... | css |
CREATE TABLE table_74185 (
"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 t... | SELECT "High rebounds" FROM table_74185 WHERE "Date" = 'October 14' | wikisql |
CREATE TABLE table_45447 (
"Round" real,
"Race Name" text,
"Pole position" text,
"Winning driver" text,
"Winning Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What pole position did 2006 gehl championship finale have?
| SELECT "Pole position" FROM table_45447 WHERE "Race Name" = '2006 gehl championship finale' | wikisql |
CREATE TABLE table_7302 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Away captain with a Venue that is old trafford?
| SELECT "Away captain" FROM table_7302 WHERE "Venue" = 'old trafford' | wikisql |
CREATE TABLE table_18569389_1 (
title VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the title for production code 2t6908
| SELECT title FROM table_18569389_1 WHERE production_code = "2T6908" | sql_create_context |
CREATE TABLE table_12261926_2 (
intergiro_classification VARCHAR,
stage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the intergiro classification of stage 21?
| SELECT intergiro_classification FROM table_12261926_2 WHERE stage = 21 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year > "2175" | mimicsql_data |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code... | 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 23 AND date_day.month_number = 4 A... | atis |
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Rankin... | SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY SUM(Memory_in_G) DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.