instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_42476 (
"Year" real,
"Winner (Male)" text,
"Winner (Female)" text,
"Talent (Male)" text,
"Talent (Female)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the female talent in 1999?
| SELECT "Talent (Female)" FROM table_42476 WHERE "Year" = '1999' | wikisql |
CREATE TABLE table_name_51 (
attendance VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance at the Billericay Town home game?
| SELECT attendance FROM table_name_51 WHERE home_team = "billericay town" | sql_create_context |
CREATE TABLE table_76023 (
"Country" text,
"Total Freshwater Withdrawal (km 3 /yr)" real,
"Per Capita Withdrawal (m 3 /p/yr)" real,
"Domestic Use (m 3 /p/yr)(in %)" text,
"Industrial Use (m 3 /p/yr)(in %)" text,
"Agricultural Use (m 3 /p/yr)(in %)" text
)
-- Using valid SQLite, answer the foll... | SELECT MAX("Per Capita Withdrawal (m 3 /p/yr)") FROM table_76023 WHERE "Agricultural Use (m 3 /p/yr)(in %)" = '1363(92%)' AND "Total Freshwater Withdrawal (km 3 /yr)" < '42.7' | wikisql |
CREATE TABLE table_70871 (
"Name" text,
"Population (2009 estimate)" text,
"Largest City" text,
"Largest Metropolitan Area" text,
"Number of States" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many states has a 2009 estimate population of 27,... | SELECT "Number of States" FROM table_70871 WHERE "Population (2009 estimate)" = '27,3 million' | wikisql |
CREATE TABLE table_201_10 (
id number,
"#" number,
"name" text,
"office" text,
"political party" text,
"occupation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the first mayor of austevoll ?
| SELECT "name" FROM table_201_10 ORDER BY "office" LIMIT 1 | squall |
CREATE TABLE table_71420 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- After 1961, who as the Entrant when the engine was a Ferrari v8, and when the points were lower than 23?
| SELECT "Entrant" FROM table_71420 WHERE "Year" > '1961' AND "Engine" = 'ferrari v8' AND "Points" < '23' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 40 AND 49) AND STRFTIME('%y', labevents.c... | mimic_iii |
CREATE TABLE table_72459 (
"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.
-- How ma... | SELECT COUNT("Game") FROM table_72459 WHERE "Record" = '26-21' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vasopressors - phenylephrine (neosynephr... | eicu |
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 prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88404 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'clonazepam' ORDER BY prescriptions.startdate DESC L... | mimic_iii |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE journal (
journalid int,
journalname va... | SELECT DISTINCT paper.paperid FROM author, keyphrase, paper, paperkeyphrase, venue, writes WHERE author.authorname = 'li dong' AND keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016 AND venue.venueid = pape... | scholar |
CREATE TABLE table_name_63 (
displacement VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the displacement for 1935-45
| SELECT displacement FROM table_name_63 WHERE year = "1935-45" | sql_create_context |
CREATE TABLE table_26499 (
"Administrative division" text,
"Area (km\u00b2) 2011**" text,
"Population 2001 Census (Adjusted)" real,
"Population 2011 Census (Adjusted)" real,
"Population density (/km\u00b2 2011)" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Administrative division" FROM table_26499 WHERE "Population density (/km\u00b2 2011)" = '4,491.8' | wikisql |
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 diagnoses (
... | SELECT demographic.admittime FROM demographic WHERE demographic.subject_id = "29961" | mimicsql_data |
CREATE TABLE review (
i_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different items were reviewed by some users?
| SELECT COUNT(DISTINCT i_id) FROM review | sql_create_context |
CREATE TABLE table_31689 (
"Place" real,
"Title" text,
"Units sold in Japan" text,
"Units sold in the UK" text,
"Units sold in the US" text,
"Total units sold" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many units were sold in the US of ... | SELECT "Units sold in the US" FROM table_31689 WHERE "Units sold in Japan" = '346,000' | wikisql |
CREATE TABLE table_11354111_3 (
night_rank VARCHAR,
rating VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the night rank with rating of 6.2
| SELECT night_rank FROM table_11354111_3 WHERE rating = "6.2" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '23981403' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_26 (
opponent VARCHAR,
save VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Opponent when the Save was || 36,388 ||15-7||?
| SELECT opponent FROM table_name_26 WHERE save = "|| 36,388 ||15-7||" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '93699422590' AND t_kc22.UP_LIMIT_AMO > 5808.74 | css |
CREATE TABLE table_name_32 (
save VARCHAR,
opponent VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who earned the save in the game against the Sinon Bulls when Jeriome Robertson took the loss?
| SELECT save FROM table_name_32 WHERE opponent = "sinon bulls" AND loss = "jeriome robertson" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "UNKNOWN/NOT SPECIFIED" AND diagnoses.long_title = "Mitral valve insufficiency and aortic valve insufficiency" | mimicsql_data |
CREATE TABLE table_204_620 (
id number,
"title" text,
"year" number,
"language" text,
"role" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total years on the chart
| SELECT COUNT(DISTINCT "year") FROM table_204_620 | squall |
CREATE TABLE table_name_41 (
gp_gs VARCHAR,
effic VARCHAR,
avg_g VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many gp-gs have 121.70 as an effic and an avg/g less than 218.7?
| SELECT COUNT(gp_gs) FROM table_name_41 WHERE effic = "121.70" AND avg_g < 218.7 | sql_create_context |
CREATE TABLE table_73135 (
"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.
-- Name the number of party for richard l. hanna (r) 53.1% mike arcuri (d) ... | SELECT COUNT("Party") FROM table_73135 WHERE "Candidates" = 'Richard L. Hanna (R) 53.1% Mike Arcuri (D) 46.9%' | wikisql |
CREATE TABLE table_203_721 (
id number,
"school" text,
"location" text,
"control" text,
"type" text,
"enrollment" number,
"founded" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which school had the largest enrollment ?
| SELECT "school" FROM table_203_721 ORDER BY "enrollment" DESC LIMIT 1 | squall |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Pleas... | SELECT title, SUM(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title | nvbench |
CREATE TABLE table_75227 (
"Year" real,
"Class" text,
"Team" text,
"Machine" text,
"Points" real,
"Rank" text,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year had a team of Aprilia and a rank of 4th?
| SELECT "Year" FROM table_75227 WHERE "Team" = 'aprilia' AND "Rank" = '4th' | wikisql |
CREATE TABLE table_37480 (
"Date" text,
"City" text,
"Result" text,
"Score" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which City has a Date of june 9, 1976?
| SELECT "City" FROM table_37480 WHERE "Date" = 'june 9, 1976' | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.long_title = "Other disorders of the pituitary and other syndromes of diencephalohypophyseal origin" | mimicsql_data |
CREATE TABLE table_2562572_2 (
population__2011_ VARCHAR,
population__2002_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of 2011 populations having a 2002 population of 29449?
| SELECT COUNT(population__2011_) FROM table_2562572_2 WHERE population__2002_ = 29449 | sql_create_context |
CREATE TABLE table_535 (
"Series #" real,
"Season #" real,
"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 name of the episode that Richard Thorpe directed?
| SELECT "Title" FROM table_535 WHERE "Directed by" = 'Richard Thorpe' | wikisql |
CREATE TABLE table_8664 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game site" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the week that was a bye before week 6?
| SELECT "Result" FROM table_8664 WHERE "Week" < '6' AND "Game site" = 'bye' | wikisql |
CREATE TABLE table_name_41 (
discoverer_s_ VARCHAR,
aphelion__au_ VARCHAR,
year_discovered VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the discoverer of the object with an Aphelion above 97 in 2004?
| SELECT discoverer_s_ FROM table_name_41 WHERE aphelion__au_ > 97 AND year_discovered = 2004 | sql_create_context |
CREATE TABLE table_name_96 (
score VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the match played against away team Arsenal?
| SELECT score FROM table_name_96 WHERE away_team = "arsenal" | sql_create_context |
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year int
)
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of text
)
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age ... | SELECT Country, COUNT(*) FROM people GROUP BY Country ORDER BY Country | nvbench |
CREATE TABLE table_204_981 (
id number,
"ep#" number,
"title" text,
"broadcast date" text,
"written by" text,
"directed by" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- title of the episode that came before the one directed by bob balaban
| SELECT "title" FROM table_204_981 WHERE "ep#" = (SELECT "ep#" FROM table_204_981 WHERE "directed by" = 'bob balaban') - 1 | squall |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'po2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 162) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'sta... | mimic_iii |
CREATE TABLE table_6468 (
"English name" text,
"Bulgarian name" text,
"Bulgarian name ( Transliteration )" text,
"Old Bulgarian Names" text,
"Old Bulgarian name (Transliteration)" text,
"Old Bulgarian name - Meaning" text
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT "Bulgarian name" FROM table_6468 WHERE "English name" = 'september' | wikisql |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT * FROM Posts JOIN PostTags ON PostTags.PostId = Posts.Id JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName LIKE 'refactoring' OR Tags.TagName LIKE 'design-patterns' OR Tags.TagName LIKE 'anti-patterns' OR Tags.TagName LIKE 'code-cleanup' OR Tags.TagName LIKE 'architecture' OR Tags.TagName LIKE 'software-d... | sede |
CREATE TABLE table_name_91 (
venue VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue hosted the 2003 event?
| SELECT venue FROM table_name_91 WHERE year = 2003 | sql_create_context |
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_... | SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_25227 (
"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.
-- Name t... | SELECT "High assists" FROM table_25227 WHERE "Date" = 'December 9' | wikisql |
CREATE TABLE table_name_56 (
ticket_price_s_ VARCHAR,
date_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the ticket price on September 16, 1986?
| SELECT ticket_price_s_ FROM table_name_56 WHERE date_s_ = "september 16, 1986" | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABL... | WITH TaggedPosts(PostId) AS (SELECT pt.PostId AS PostId FROM PostTags AS pt INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName LIKE '%' + '##tag:string##' + '%' GROUP BY pt.PostId) SELECT Id AS "post_link", * FROM Posts WHERE Id IN (SELECT PostId FROM TaggedPosts) AND PostTypeId = 1 AND AnswerCount = 0 AND NOT Acc... | sede |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE equipment_sequence (
aircr... | 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, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_se... | atis |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
... | SELECT SUM(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 = '017-30730')) AND intakeoutput.celllabel = 'per i... | eicu |
CREATE TABLE table_63612 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has a To par of +1 in sweden?
| SELECT "Score" FROM table_63612 WHERE "To par" = '+1' AND "Country" = 'sweden' | wikisql |
CREATE TABLE accelerator_compatible_browser (
accelerator_id int,
browser_id int,
compatible_since_year int
)
CREATE TABLE Web_client_accelerator (
id int,
name text,
Operating_system text,
Client text,
Connection text
)
CREATE TABLE browser (
id int,
name text,
market_shar... | SELECT Operating_system, COUNT(*) FROM Web_client_accelerator GROUP BY Operating_system ORDER BY Operating_system | nvbench |
CREATE TABLE table_name_59 (
points INTEGER,
rank VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of the points for wins under 6 and a rank of 2nd?
| SELECT SUM(points) FROM table_name_59 WHERE rank = "2nd" AND wins < 6 | sql_create_context |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB 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 jybgb.JYLX FROM jybgb WHERE jybgb.BGDH = '11875806581' | css |
CREATE TABLE table_3335 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the dominant... | SELECT "Dominant religion (2002)" FROM table_3335 WHERE "Type" = 'village' AND "Settlement" = 'Banatski Despotovac' | wikisql |
CREATE TABLE table_71284 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" text,
"Finish" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did team scandia finish when their engine was cosworth?
| SELECT "Finish" FROM table_71284 WHERE "Engine" = 'cosworth' AND "Team" = 'team scandia' | wikisql |
CREATE TABLE table_26890 (
"Candidate" text,
"Background" text,
"Original team" text,
"Age" real,
"Hometown" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many age figures for the player fired in week 6?
| SELECT COUNT("Age") FROM table_26890 WHERE "Result" = 'Fired in week 6' | wikisql |
CREATE TABLE table_27730_9 (
ijekavian VARCHAR,
ikavian VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the ijekavian translation of the ikavian word grijati?
| SELECT ijekavian FROM table_27730_9 WHERE ikavian = "grijati" | sql_create_context |
CREATE TABLE table_name_19 (
record VARCHAR,
game VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Record for a game less than 3 and the score was l 91 96 (ot)?
| SELECT record FROM table_name_19 WHERE game < 3 AND score = "l 91–96 (ot)" | sql_create_context |
CREATE TABLE table_9283 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has a Record of 5-4?
| SELECT "Score" FROM table_9283 WHERE "Record" = '5-4' | wikisql |
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 gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '潘和正' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-11-28' AND '2019-10-22' AND t_kc24.MED_AMOUT <= 10 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.P... | css |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score num... | SELECT u.Id AS "user_link", u.Location, COUNT(a.Id) AS xCount, SUM(a.Score) AS xSum FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id JOIN Users AS u ON a.OwnerUserId = u.Id WHERE a.PostTypeId = '2' AND (@Empty = 0 OR u.Location IS NULL) AND (@Empty = 0 OR u.Location = '') AND LOWER(u.Location) LIKE '%' + @Location ... | sede |
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 gwyjzb.MED_ORG_DEPT_CD, gwyjzb.MED_ORG_DEPT_NM FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '8225788' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-08-01' AND '2012-05-12' GROUP BY gwyjzb.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 5 UNION SELECT fgw... | css |
CREATE TABLE table_204_880 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 51st position and 31st position were both obtained by this runner ... | SELECT "competition" FROM table_204_880 WHERE "position" = 51 | squall |
CREATE TABLE table_12651 (
"Perpetrator" text,
"Year" text,
"Location" text,
"Country" text,
"Killed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which location is in the Belgian Congo Tanganyika?
| SELECT "Location" FROM table_12651 WHERE "Country" = 'belgian congo tanganyika' | wikisql |
CREATE TABLE table_204_246 (
id number,
"department" text,
"total deputies" number,
"uninominal deputies" number,
"plurinominal deputies" number,
"special indigenous\nor campesino deputies" number,
"senators" number
)
-- Using valid SQLite, answer the following questions for the tables pro... | SELECT "department" FROM table_204_246 WHERE "department" IN ('cochabamba', 'chuquisaca') ORDER BY "special indigenous\nor campesino deputies" DESC LIMIT 1 | squall |
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJG... | css |
CREATE TABLE table_5840 (
"Race" text,
"Length" text,
"Class" text,
"Circuit" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which date was the GT class at Monterey Sports Car Grand Prix?
| SELECT "Date" FROM table_5840 WHERE "Class" = 'gt' AND "Race" = 'monterey sports car grand prix' | wikisql |
CREATE TABLE table_75126 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the following questions f... | SELECT "Tries against" FROM table_75126 WHERE "Tries for" = '32' | wikisql |
CREATE TABLE table_34152 (
"Round" text,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What round was matt brait?
| SELECT "Round" FROM table_34152 WHERE "Player" = 'matt brait' | wikisql |
CREATE TABLE table_28171 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the episode th... | SELECT "Directed by" FROM table_28171 WHERE "Production code" = '2J5457' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE gsi (
course_offeri... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN area ON student_record.course_id = area.course_id WHERE area.area LIKE '%software%' AND student_record.student_id = 1 | advising |
CREATE TABLE table_2513 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "Avg. Start" FROM table_2513 WHERE "Avg. Finish" = '29.0' | wikisql |
CREATE TABLE table_1648 (
"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.
-- Name th... | SELECT "High assists" FROM table_1648 WHERE "Team" = 'Houston' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
c... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 664 AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-5 year') | eicu |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskStates (
Id number,
Na... | SELECT Posts.Id AS "post_link", Posts.Tags, PostInits.Text AS "initial_tags", Posts.CreationDate FROM Posts INNER JOIN (SELECT PostId, Text FROM PostHistory WHERE PostHistoryTypeId = 3 AND Text LIKE '%##Tag##%') AS PostInits ON Posts.Id = PostInits.PostId WHERE NOT Posts.Tags LIKE '%##Tag##%' AND (DATEDIFF(month, Posts... | sede |
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 labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28966) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-50... | mimic_iii |
CREATE TABLE table_48636 (
"Title" text,
"Writer" text,
"Format" text,
"Company" text,
"release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the release date of the album written by Goss, James James Goss under Audiogo?
| SELECT "release date" FROM table_48636 WHERE "Writer" = 'goss, james james goss' AND "Company" = 'audiogo' | wikisql |
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | SELECT Openning_year, AVG(Capacity) FROM cinema GROUP BY Openning_year ORDER BY AVG(Capacity) DESC | nvbench |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '52511497' AND t_kc22.STA_DATE BETWEEN '2004-11-24' AND '2016-01-08' AND t_kc22.SOC_SRT_DIRE_CD = '107476384' | css |
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 demographic.age, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_name_31 (
date VARCHAR,
week VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what Date prior to Week 14 was the Record 7-1?
| SELECT date FROM table_name_31 WHERE week < 14 AND record = "7-1" | sql_create_context |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... | atis |
CREATE TABLE table_204_415 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in season 1996/97 was the place above or below 10th ?
| SELECT (SELECT "place" FROM table_204_415 WHERE "season" = '1996/97') < 10 | squall |
CREATE TABLE table_name_4 (
player VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player scored 71?
| SELECT player FROM table_name_4 WHERE score = 71 | sql_create_context |
CREATE TABLE table_7910 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text,
"Competition" text,
"Man of the Match" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of the Competition with Man of the... | SELECT "Date" FROM table_7910 WHERE "Man of the Match" = 'ollie bronnimann' | wikisql |
CREATE TABLE table_name_16 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the home team when the away team is newcastle united?
| SELECT home_team FROM table_name_16 WHERE away_team = "newcastle united" | sql_create_context |
CREATE TABLE table_25190 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How ma... | SELECT COUNT("Game") FROM table_25190 WHERE "Date" = 'May 11' | wikisql |
CREATE TABLE table_name_90 (
developer_s_ VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Developer(s) has a Year of 2010?
| SELECT developer_s_ FROM table_name_90 WHERE year = 2010 | sql_create_context |
CREATE TABLE table_name_65 (
episode INTEGER,
segment_c VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest episode of Wood Flutes segment c?
| SELECT MAX(episode) FROM table_name_65 WHERE segment_c = "wood flutes" | sql_create_context |
CREATE TABLE table_47286 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2010 value with a 1r in 2012 a... | SELECT "2010" FROM table_47286 WHERE "2012" = '1r' AND "2005" = 'a' | wikisql |
CREATE TABLE table_22723 (
"Rank" real,
"Metropolitan Statistical Area" text,
"Total Population (2010)" real,
"Indian American Population (2010)" real,
"% Indian American" text,
"Asian American Population (2010)" real,
"% Asian American" text,
"Combined Statistical Area" text
)
-- Usin... | SELECT "% Asian American" FROM table_22723 WHERE "Indian American Population (2010)" = '23526' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'albuterol-ipratropium' AND STRFTIME('%y', prescriptions.startdate) = '2105' | mimic_iii |
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Detention (
detention_id INTEGER,
detention_type_code VARCHAR(10),
te... | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_name_15 (
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE DATE WITH AN AWAY TEAM OF BURTON ALBION?
| SELECT date FROM table_name_15 WHERE away_team = "burton albion" | sql_create_context |
CREATE TABLE company (
Name VARCHAR,
Industry VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the names of companies in the banking or retailing industry?
| SELECT Name FROM company WHERE Industry = "Banking" OR Industry = "Retailing" | sql_create_context |
CREATE TABLE table_74069 (
"Player" text,
"Team" text,
"Matches" real,
"Runs" real,
"Average" text,
"Strike rate" text,
"Highest Score" text,
"100s" real,
"50s" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the team is Worcesters... | SELECT "Highest Score" FROM table_74069 WHERE "Matches" = '5' AND "Team" = 'Worcestershire' | wikisql |
CREATE TABLE checking (
custid number,
balance number
)
CREATE TABLE accounts (
custid number,
name text
)
CREATE TABLE savings (
custid number,
balance number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of checking accounts for ... | SELECT COUNT(*), T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name | spider |
CREATE TABLE table_name_5 (
year INTEGER,
music_director_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHich Year has a Music director(s) of anu malik?
| SELECT SUM(year) FROM table_name_5 WHERE music_director_s_ = "anu malik" | sql_create_context |
CREATE TABLE table_203_570 (
id number,
"#" number,
"title" text,
"tpb isbn" text,
"tpb release date" text,
"tpb page number" number,
"collected material" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long was the big ride ?
| SELECT "tpb page number" FROM table_203_570 WHERE "title" = 'the big ride' | squall |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND diagnoses.long_title = "Other pulmonary insufficiency, not elsewhere classified" | mimicsql_data |
CREATE TABLE table_name_95 (
silver INTEGER,
nation VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest amount of silver medals Iceland, who has less than 87 medals, has?
| SELECT MIN(silver) FROM table_name_95 WHERE nation = "iceland" AND total < 87 | sql_create_context |
CREATE TABLE table_38402 (
"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.
-- What is the smallest number of wins for a top-25 value greater t... | SELECT MIN("Wins") FROM table_38402 WHERE "Top-25" > '5' AND "Cuts made" > '38' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.