instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_15261 (
"Rank" real,
"Team" text,
"Country" text,
"Value ($M)" real,
"Revenue ($M)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the rank for tottenham hotspur
| SELECT "Rank" FROM table_15261 WHERE "Team" = 'tottenham hotspur' | wikisql |
CREATE TABLE table_12807904_3 (
tries_for VARCHAR,
drawn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- HOW MANY GAMES WERE TIED AT 3?
| SELECT tries_for FROM table_12807904_3 WHERE drawn = "3" | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Fentanyl Citrate" | mimicsql_data |
CREATE TABLE table_name_77 (
points_against VARCHAR,
try_bonus VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Points Against, when Try Bonus is 'Try bonus'?
| SELECT points_against FROM table_name_77 WHERE try_bonus = "try bonus" | sql_create_context |
CREATE TABLE table_65577 (
"School" text,
"Location" text,
"Mascot" text,
"Size" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What county has a school with less than 301 stude... | SELECT "County" FROM table_65577 WHERE "IHSAA Football Class" = 'a' AND "Size" < '301' | wikisql |
CREATE TABLE table_name_87 (
location VARCHAR,
opponent_team VARCHAR,
match VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the location of the friendly match larger than 1 where the Super Reds were the opponent?
| SELECT location FROM table_name_87 WHERE match > 1 AND tournament = "friendly" AND opponent_team = "super reds" | sql_create_context |
CREATE TABLE table_name_66 (
overall INTEGER,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is stanford's average overall?
| SELECT AVG(overall) FROM table_name_66 WHERE college = "stanford" | sql_create_context |
CREATE TABLE table_name_55 (
venue VARCHAR,
sport VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue does the soccer team Pennsylvania Stoners play in?
| SELECT venue FROM table_name_55 WHERE sport = "soccer" AND club = "pennsylvania stoners" | sql_create_context |
CREATE TABLE table_name_79 (
school VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the school that has a player named Michael Dunigan?
| SELECT school FROM table_name_79 WHERE player = "michael dunigan" | sql_create_context |
CREATE TABLE table_75937 (
"Draw" real,
"Song" text,
"Performer" text,
"Points" real,
"Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which song has more than 66 points, a draw greater than 3, and is ranked 3rd?
| SELECT "Song" FROM table_75937 WHERE "Points" > '66' AND "Draw" > '3' AND "Rank" = '3rd' | wikisql |
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 is the total number of deanery as new haven... | SELECT COUNT("deanery") FROM table_204_540 WHERE "town" = 'new haven' | squall |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskSt... | SELECT ROW_NUMBER() OVER (ORDER BY (CAST(Views AS FLOAT) / CAST(Reputation AS FLOAT)) DESC) AS Rank, Id AS "user_link", CAST(Views AS FLOAT) / CAST(Reputation AS FLOAT), Views, Reputation FROM Users WHERE Reputation >= 1000 LIMIT 1000 | sede |
CREATE TABLE Catalog_Structure (
catalog_level_number INTEGER,
catalog_id INTEGER,
catalog_level_name VARCHAR(50)
)
CREATE TABLE Attribute_Definitions (
attribute_id INTEGER,
attribute_name VARCHAR(30),
attribute_data_type VARCHAR(10)
)
CREATE TABLE Catalogs (
catalog_id INTEGER,
catal... | SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10 ORDER BY catalog_level_number | nvbench |
CREATE TABLE table_41985 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a total number of 76 silver medals?
| SELECT COUNT("Silver") FROM table_41985 WHERE "Total" = '76' | wikisql |
CREATE TABLE table_31276 (
"Rank" real,
"English title" text,
"Chinese title" text,
"Average" real,
"Peak" real,
"Premiere" real,
"Finale" real,
"HK viewers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of the averag... | SELECT MAX("Average") FROM table_31276 WHERE "Chinese title" = '魚躍在花見' | wikisql |
CREATE TABLE table_16796625_1 (
code VARCHAR,
municipality VARCHAR,
population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many codes have a population of 598 in Vellinge Municipality?
| SELECT COUNT(code) FROM table_16796625_1 WHERE municipality = "Vellinge municipality" AND population = 598 | sql_create_context |
CREATE TABLE table_name_45 (
area_km_2 INTEGER,
status VARCHAR,
official_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the area of drummond village?
| SELECT MAX(area_km_2) FROM table_name_45 WHERE status = "village" AND official_name = "drummond" | sql_create_context |
CREATE TABLE table_name_81 (
score VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Canada's score?
| SELECT score FROM table_name_81 WHERE country = "canada" | sql_create_context |
CREATE TABLE table_name_64 (
year VARCHAR,
avg_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the year that had an average attendance of 5,445?
| SELECT year FROM table_name_64 WHERE avg_attendance = "5,445" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-47576')) AND DATETIME(treatment.treatmenttime, 'start of year... | eicu |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2056" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
descript... | 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILAD... | atis |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT AVG(1.0 * CASE WHEN Votes.VoteTypeId = 1 THEN 15 WHEN Votes.VoteTypeId = 3 THEN -2 WHEN Posts.PostTypeId = 1 THEN 5 ELSE 10 END) AS Rep, Posts.PostTypeId FROM Posts, Votes WHERE Votes.PostId = Posts.Id AND Votes.VoteTypeId <= 3 AND Posts.PostTypeId <= 2 GROUP BY Posts.PostTypeId | sede |
CREATE TABLE table_686 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest year where the result of the election was a retired r... | SELECT MIN("First elected") FROM table_686 WHERE "Result" = 'Retired Republican hold' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'famotidine 20 mg tablet' AND STRFTIME('%y', medicat... | eicu |
CREATE TABLE table_24874 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the ep... | SELECT "Title" FROM table_24874 WHERE "Production code" = '11.12' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.age >= "70" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid nu... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 267 AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-4 year') | eicu |
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_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3990035' GROUP BY t_kc21.OUT_DIAG_DIS_NM | css |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Road, Team_ID FROM basketball_match ORDER BY Team_ID DESC | nvbench |
CREATE TABLE table_name_53 (
name VARCHAR,
term_end VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the prime minister that had a term that ended on 5 March 1930?
| SELECT name FROM table_name_53 WHERE term_end = "5 march 1930" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_69854 (
"Tournament" text,
"2008" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2010 with tournament of grand slam tournaments
| SELECT "2010" FROM table_69854 WHERE "Tournament" = 'grand slam tournaments' | wikisql |
CREATE TABLE table_53602 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"Career Win\u2013Loss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2010 value with A in 2008, A in... | SELECT "2010" FROM table_53602 WHERE "2008" = 'a' AND "2011" = 'a' AND "2012" = '2r' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-34108' AND NOT patient.hospitaldischargetime IS NULL ORDER BY p... | eicu |
CREATE TABLE table_45721 (
"Japanese" text,
"R\u014dmaji" text,
"Meaning" text,
"Chinese" text,
"Romanization" text,
"Source language" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Romanization of the Mandarin word whose R maji is r... | SELECT "Romanization" FROM table_45721 WHERE "Source language" = 'mandarin' AND "R\u014dmaji" = 'ūroncha' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.gender = "M" | mimicsql_data |
CREATE TABLE table_31125 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the episode titled 'who... | SELECT "Directed by" FROM table_31125 WHERE "Title" = 'Who Nose' | wikisql |
CREATE TABLE table_name_99 (
date VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date for the game where Platense was the home side?
| SELECT date FROM table_name_99 WHERE home = "platense" | sql_create_context |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT Date_of_Birth, Weight FROM people ORDER BY Weight DESC | nvbench |
CREATE TABLE table_name_64 (
mountain_range VARCHAR,
mountain_peak VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which mountain range includes Mount Hubbard?
| SELECT mountain_range FROM table_name_64 WHERE mountain_peak = "mount hubbard" | sql_create_context |
CREATE TABLE table_29553 (
"Season" text,
"Points per Game" text,
"Total Yards per Game" text,
"Rushing Yards per Game" text,
"Passing Yards per Game" text,
"Sacks" text,
"Interceptions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is... | SELECT "Sacks" FROM table_29553 WHERE "Interceptions" = '19' | wikisql |
CREATE TABLE table_27318 (
"Region" text,
"Enrolled men" real,
"Enrolled women" real,
"Enrolled total" real,
"Men of voting age" real,
"Women of voting age" real,
"Voting age population" real,
"E/VAP ratio Men" text,
"E/VAP ratio Women" text,
"E/VAP ratio Total" text
)
-- Using... | SELECT "Enrolled women" FROM table_27318 WHERE "E/VAP ratio Women" = '108.6%' | wikisql |
CREATE TABLE table_54015 (
"Round" text,
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which nationality has a round of 1, and F position from Louisvill... | SELECT "Nationality" FROM table_54015 WHERE "Round" = '1' AND "Position" = 'f' AND "College" = 'louisville' | wikisql |
CREATE TABLE table_name_63 (
venue VARCHAR,
third VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the venue when Jack Hargreaves finished third?
| SELECT venue FROM table_name_63 WHERE third = "jack hargreaves" | sql_create_context |
CREATE TABLE nomination (
artwork_id number,
festival_id number,
result text
)
CREATE TABLE festival_detail (
festival_id number,
festival_name text,
chair_name text,
location text,
year number,
num_of_audience number
)
CREATE TABLE artwork (
artwork_id number,
type text,
... | SELECT T2.name, T3.festival_name FROM nomination AS T1 JOIN artwork AS T2 ON T1.artwork_id = T2.artwork_id JOIN festival_detail AS T3 ON T1.festival_id = T3.festival_id | spider |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE c... | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'iso-osmotic dextrose' AND admissions.subject_id = 50480 AND STRFTIME('%y-%m', prescriptions.startdate) <= '2100-02') AS t1 JOIN (SE... | 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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '52346319' AND t_kc22.STA_DATE BETWEEN '2002-05-20' AND '2002-10-06' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC L... | css |
CREATE TABLE table_name_15 (
goals_for INTEGER,
points VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals were scored by the team that played less than 38 games, and had points of 47+9?
| SELECT MAX(goals_for) FROM table_name_15 WHERE points = "47+9" AND played < 38 | sql_create_context |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,... | WITH GermanUsers AS (SELECT Id, Location, AboutMe, CreationDate, LastAccessDate, Reputation, CAST((LastAccessDate - CreationDate) AS FLOAT) AS TimeOnSite FROM Users WHERE LOWER(Location) LIKE '%germany%' OR LOWER(Location) LIKE '%deutschland%') SELECT Id AS "user_link", Location, AboutMe, TimeOnSite, Reputation, (CAST(... | sede |
CREATE TABLE table_16093 (
"School Year" text,
"Class A" text,
"Class AA" text,
"Class AAA" text,
"Class AAAA" text,
"Class AAAAA" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was Class AAAAA during the school year of 1995-96?
| SELECT "Class AAAAA" FROM table_16093 WHERE "School Year" = '1995-96' | wikisql |
CREATE TABLE table_4813 (
"Rank" real,
"Heat : Lane" text,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank for Heat : Lane of 4 : 1?
| SELECT "Rank" FROM table_4813 WHERE "Heat : Lane" = '4 : 1' | wikisql |
CREATE TABLE affiliated_with (
physician number,
department number,
primaryaffiliation boolean
)
CREATE TABLE stay (
stayid number,
patient number,
room number,
staystart time,
stayend time
)
CREATE TABLE medication (
code number,
name text,
brand text,
description text... | SELECT COUNT(*) FROM patient WHERE NOT ssn IN (SELECT T1.patient FROM prescribes AS T1 JOIN medication AS T2 ON T1.medication = T2.code WHERE T2.name = 'Procrastin-X') | spider |
CREATE TABLE table_427 (
"State" text,
"Preliminaries" text,
"Interview" text,
"Swimsuit" text,
"Evening Gown" text,
"Average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for swimsuit when the average is 8.791?
| SELECT "Swimsuit" FROM table_427 WHERE "Average" = '8.791' | wikisql |
CREATE TABLE table_17699 (
"Rank in Nyagatare Sectors, 2012" real,
"Sector" text,
"Area in sqkm" real,
"Population August 15, 2012" real,
"Population, August 15, 2002" real,
"Population Change 2002-2012 (%)" text,
"Population Density 2012 (km 2 )" real
)
-- Using valid SQLite, answer the f... | SELECT "Sector" FROM table_17699 WHERE "Population Change 2002-2012 (%)" = '79.6' | wikisql |
CREATE TABLE table_name_70 (
city___state VARCHAR,
winner VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Jim Richards won at the Winton Motor Raceway circuit, what was the city and state listed?
| SELECT city___state FROM table_name_70 WHERE winner = "jim richards" AND circuit = "winton motor raceway" | sql_create_context |
CREATE TABLE table_1342370_17 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which district is James O'Connor the incumbent?
| SELECT district FROM table_1342370_17 WHERE incumbent = "James O'Connor" | sql_create_context |
CREATE TABLE table_name_16 (
mission VARCHAR,
resident_country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mission for switzerland as a resident County?
| SELECT mission FROM table_name_16 WHERE resident_country = "switzerland" | sql_create_context |
CREATE TABLE table_name_14 (
commissioned VARCHAR,
fate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the ship that had a fate of 'converted to laker, 1961; still in service' commissioned?
| SELECT commissioned FROM table_name_14 WHERE fate = "converted to laker, 1961; still in service" | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Sc... | SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY '##Datefield##') AS RowNumber, * FROM "##Database##") AS Foo WHERE RowNumber BETWEEN '##From##' AND '##To##' | sede |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-9853')) AND DATETIME(treatment.treatmenttime) <= DATETIME(CUR... | eicu |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT mzjzjlb.KH, mzjzjlb.KLX FROM mzjzjlb WHERE mzjzjlb.JZLSH = '96594667159' | css |
CREATE TABLE table_51033 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player scored 71?
| SELECT "Player" FROM table_51033 WHERE "Score" = '71' | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.admityear < "2172" | mimicsql_data |
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 lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Stephanie Suchan" | mimicsql_data |
CREATE TABLE table_name_54 (
record VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which record has a Loss of eichhorn (8-5)?
| SELECT record FROM table_name_54 WHERE loss = "eichhorn (8-5)" | sql_create_context |
CREATE TABLE table_22073745_1 (
director VARCHAR,
original_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the director of the original title perl oder pica?
| SELECT director FROM table_22073745_1 WHERE original_title = "Perl oder Pica" | sql_create_context |
CREATE TABLE table_31249 (
"No. in series" real,
"No. in 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 is the original air d... | SELECT "Original air date" FROM table_31249 WHERE "No. in series" = '31' | wikisql |
CREATE TABLE research_staff (
staff_id number,
employer_organisation_id number,
staff_details text
)
CREATE TABLE organisation_types (
organisation_type text,
organisation_type_description text
)
CREATE TABLE project_outcomes (
project_id number,
outcome_code text,
outcome_details text... | SELECT T1.project_details FROM projects AS T1 JOIN project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Paper' INTERSECT SELECT T1.project_details FROM projects AS T1 JOIN project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Patent' | spider |
CREATE TABLE table_68945 (
"Year" text,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who won the women's singles at the same time the m... | SELECT "Women's singles" FROM table_68945 WHERE "Men's doubles" = 'seno the uun santosa' | 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 WHERE demographic.admission_type = "URGENT" AND demographic.diagnosis = "MORBID OBESITY/SDA" | mimicsql_data |
CREATE TABLE table_26013 (
"Branding" text,
"Callsign" text,
"Ch. #" text,
"Power kW" text,
"Station Type" text,
"Location (Transmitter site)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When dxzb-tv is the call sign what is the power kw?
| SELECT "Power kW" FROM table_26013 WHERE "Callsign" = 'DXZB-TV' | wikisql |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT a.Id AS "post_link", u.DisplayName AS "Asker", au.DisplayName AS "Answerer", a.Score, au.Reputation, p.CreationDate AS "Q_Date", a.CreationDate AS "A_Date" FROM Tags AS t JOIN PostTags AS pt ON pt.TagId = t.Id JOIN Posts AS p ON p.Id = pt.PostId JOIN Posts AS a ON a.ParentId = p.Id JOIN Users AS u ON p.OwnerUser... | sede |
CREATE TABLE table_40712 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what year Year has a Co-Drivers of j r me policand christopher cam... | SELECT SUM("Year") FROM table_40712 WHERE "Co-Drivers" = 'jérôme policand christopher campbell' | wikisql |
CREATE TABLE table_206217_2 (
period__h_ VARCHAR,
eccentricity VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every value of period when eccentricity is 0.583085?
| SELECT period__h_ FROM table_206217_2 WHERE eccentricity = "0.583085" | sql_create_context |
CREATE TABLE table_12519 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Bob Tway's To par?
| SELECT "To par" FROM table_12519 WHERE "Player" = 'bob tway' | wikisql |
CREATE TABLE table_29982 (
"Pick" real,
"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 educational institute does wes swinson attend
| SELECT "College/junior/club team" FROM table_29982 WHERE "Player" = 'Wes Swinson' | wikisql |
CREATE TABLE table_27512025_1 (
program VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many types are cardio?
| SELECT COUNT(program) FROM table_27512025_1 WHERE type = "Cardio" | sql_create_context |
CREATE TABLE table_name_81 (
format VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Format has a Catalog of 561 445-1?
| SELECT format FROM table_name_81 WHERE catalog = "561 445-1" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "ACIDOSIS" | mimicsql_data |
CREATE TABLE table_5545 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the Indians play on April 23?
| SELECT "Opponent" FROM table_5545 WHERE "Date" = 'april 23' | 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 ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(Team_ID) | nvbench |
CREATE TABLE table_17802778_1 (
team VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team(s) were in 2003?
| SELECT team FROM table_17802778_1 WHERE year = 2003 | sql_create_context |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
... | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ... | css |
CREATE TABLE table_name_77 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 1997's 1992 was 1r when 1994 was a?
| SELECT 1997 FROM table_name_77 WHERE 1992 = "1r" AND 1994 = "a" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | SELECT demographic.dob, demographic.expire_flag FROM demographic WHERE demographic.name = "Travis Hofman" | mimicsql_data |
CREATE TABLE classroom (
building text,
room_number text,
capacity number
)
CREATE TABLE teaches (
id text,
course_id text,
sec_id text,
semester text,
year number
)
CREATE TABLE department (
dept_name text,
building text,
budget number
)
CREATE TABLE course (
course_i... | SELECT MIN(salary), dept_name FROM instructor GROUP BY dept_name HAVING AVG(salary) > (SELECT AVG(salary) FROM instructor) | spider |
CREATE TABLE block (
blockfloor number,
blockcode number
)
CREATE TABLE procedures (
code number,
name text,
cost number
)
CREATE TABLE patient (
ssn number,
name text,
address text,
phone text,
insuranceid number,
pcp number
)
CREATE TABLE room (
roomnumber number,
... | SELECT COUNT(*), T1.blockcode FROM block AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode | spider |
CREATE TABLE table_name_50 (
game VARCHAR,
march VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games have a March of 19, and Points smaller than 83?
| SELECT COUNT(game) FROM table_name_50 WHERE march = 19 AND points < 83 | 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 demographic.marital_status, demographic.age FROM demographic WHERE demographic.name = "Stephanie Suchan" | mimicsql_data |
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 * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.... | css |
CREATE TABLE table_name_85 (
series VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- From which series is the title Barbary Coast Bunny?
| SELECT series FROM table_name_85 WHERE title = "barbary coast bunny" | sql_create_context |
CREATE TABLE table_17766232_7 (
year_s_ INTEGER,
spokesperson VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the latest year that Colin Berry was the spokesperson?
| SELECT MAX(year_s_) FROM table_17766232_7 WHERE spokesperson = "Colin Berry" | 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 WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.dob_year < "2043" | mimicsql_data |
CREATE TABLE table_72363 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What district was John Porter elected in?
| SELECT "District" FROM table_72363 WHERE "Incumbent" = 'John Porter' | wikisql |
CREATE TABLE table_name_36 (
tv_station__operator_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the 2005 of TV3 when there is less than 42 in 2007 and less than 29.5 in 2010?
| SELECT MAX(2005) FROM table_name_36 WHERE 2007 < 42 AND tv_station__operator_ = "tv3" AND 2010 < 29.5 | sql_create_context |
CREATE TABLE table_name_30 (
enrollment INTEGER,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the enrollment for the school Highland?
| SELECT SUM(enrollment) FROM table_name_30 WHERE school = "highland" | sql_create_context |
CREATE TABLE Track (
TrackId integer,
Name varchar(200),
AlbumId integer,
MediaTypeId integer,
GenreId integer,
Composer varchar(220),
Milliseconds integer,
Bytes integer,
UnitPrice decimal(10,2)
)
CREATE TABLE MediaType (
MediaTypeId integer,
Name varchar(120)
)
CREATE TAB... | SELECT InvoiceDate, COUNT(InvoiceDate) FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber" ORDER BY COUNT(InvoiceDate) | nvbench |
CREATE TABLE table_64384 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" real,
"React" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum rank of Solomon Bayoh when his time was smaller than 22.16?
| SELECT SUM("Rank") FROM table_64384 WHERE "Athlete" = 'solomon bayoh' AND "Time" < '22.16' | wikisql |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND prescriptions.route = "PO/NG" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.