instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
... | SELECT YEAR(CreationDate) AS CreationDateYear, COUNT(*) AS PostsThisYear FROM dbo.Posts WHERE OwnerUserId = 22656 GROUP BY YEAR(CreationDate) ORDER BY YEAR(CreationDate) | sede |
CREATE TABLE table_name_27 (
wins INTEGER,
losses VARCHAR,
draws VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of wins where the losses are more than 12 and the draws are less than 0?
| SELECT MIN(wins) FROM table_name_27 WHERE losses > 12 AND draws < 0 | sql_create_context |
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 (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 = 18866) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i... | mimic_iii |
CREATE TABLE table_name_56 (
year INTEGER,
start VARCHAR,
stage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the earliest year that had a start of Saint-Gaudens and a stage smaller than 15?
| SELECT MIN(year) FROM table_name_56 WHERE start = "saint-gaudens" AND stage < 15 | sql_create_context |
CREATE TABLE table_name_81 (
launched VARCHAR,
territory VARCHAR,
channel VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did channel 83 in singapore launch?
| SELECT launched FROM table_name_81 WHERE territory = "singapore" AND channel = 83 | sql_create_context |
CREATE TABLE table_name_97 (
result VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for the match held in Boston?
| SELECT result FROM table_name_97 WHERE location = "boston" | sql_create_context |
CREATE TABLE table_74950 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Bronze is the lowest one that has a Rank of 3, and a Silver smaller than 2?
| SELECT MIN("Bronze") FROM table_74950 WHERE "Rank" = '3' AND "Silver" < '2' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid ... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperlipidemia') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient O... | eicu |
CREATE TABLE table_204_888 (
id number,
"location" text,
"mile" number,
"destinations" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the exit beofre virginia avenue ?
| SELECT "destinations" FROM table_204_888 WHERE id = (SELECT id FROM table_204_888 WHERE "destinations" = 'virginia avenue to us 522 north') - 1 | squall |
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 prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND demographic.age < "31" | mimicsql_data |
CREATE TABLE table_name_8 (
pitcher VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the pitcher on september 6, 2006
| SELECT pitcher FROM table_name_8 WHERE date = "september 6, 2006" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "UPPER GI BLEED" | mimicsql_data |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
-- Using valid SQLite, answer the following questions fo... | SELECT Fate, COUNT(Fate) FROM mission GROUP BY Fate ORDER BY Fate DESC | nvbench |
CREATE TABLE table_70579 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team when the attendance was 7,891?
| SELECT "Away team" FROM table_70579 WHERE "Attendance" = '7,891' | wikisql |
CREATE TABLE table_name_41 (
competition VARCHAR,
venue VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Away Competition had a Result of lost 2-4?
| SELECT competition FROM table_name_41 WHERE venue = "away" AND result = "lost 2-4" | sql_create_context |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TA... | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | atis |
CREATE TABLE table_37655 (
"Surname" text,
"First" text,
"D.O.B." text,
"Bats" text,
"Throws" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which DOB has a Surname of cresswell?
| SELECT "D.O.B." FROM table_37655 WHERE "Surname" = 'cresswell' | wikisql |
CREATE TABLE table_name_31 (
title VARCHAR,
year VARCHAR,
genre VARCHAR,
network VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the title when the genre is drama with a network of KBS2 happening in 2011?
| SELECT title FROM table_name_31 WHERE genre = "drama" AND network = "kbs2" AND year = 2011 | sql_create_context |
CREATE TABLE table_4564 (
"Year" real,
"Network" text,
"Play-by-play" text,
"Color commentator(s)" text,
"Sideline reporter(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the collor commentator(s) for ESPN before 2012?
| SELECT "Color commentator(s)" FROM table_4564 WHERE "Year" < '2012' AND "Network" = 'espn' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE days (
days_code varchar,
da... | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND flight.from_airport... | atis |
CREATE TABLE table_32699 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many golds for teams ranking below 7 with 3 bronze and less than 5 total medals?
| SELECT COUNT("Gold") FROM table_32699 WHERE "Bronze" = '3' AND "Rank" > '7' AND "Total" < '5' | wikisql |
CREATE TABLE table_name_92 (
award VARCHAR,
result VARCHAR,
category VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Award has a nominated, and outstanding choreography?
| SELECT award FROM table_name_92 WHERE result = "nominated" AND category = "outstanding choreography" | sql_create_context |
CREATE TABLE table_204_866 (
id number,
"name" text,
"lifetime" text,
"nationality" text,
"notable as" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which name is before sam falson
| SELECT "name" FROM table_204_866 WHERE id = (SELECT id FROM table_204_866 WHERE "name" = 'sam falson') - 1 | squall |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTa... | SELECT UserId AS "user_link", SUM(c) AS s FROM (SELECT UserId, COUNT(*) AS c FROM PostHistory WHERE UserId > 0 GROUP BY UserId UNION ALL SELECT UserId, COUNT(*) AS c FROM Comments WHERE UserId > 0 GROUP BY UserId UNION ALL SELECT UserId, COUNT(*) AS c FROM Votes WHERE UserId > 0 GROUP BY UserId) AS Actions GROUP BY Use... | sede |
CREATE TABLE table_204_823 (
id number,
"dates" text,
"location" text,
"attendance" text,
"official guests" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- where was the first location used in august , 1976 ?
| SELECT "location" FROM table_204_823 WHERE "dates" = 1976 AND "dates" = 8 | squall |
CREATE TABLE table_name_23 (
headquarters VARCHAR,
employees__world_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which HQ is associated with a number of employees of 100?
| SELECT headquarters FROM table_name_23 WHERE employees__world_ = 100 | sql_create_context |
CREATE TABLE web_client_accelerator (
id number,
name text,
operating_system text,
client text,
connection text
)
CREATE TABLE browser (
id number,
name text,
market_share number
)
CREATE TABLE accelerator_compatible_browser (
accelerator_id number,
browser_id number,
compa... | SELECT operating_system, COUNT(*) FROM web_client_accelerator GROUP BY operating_system | spider |
CREATE TABLE table_38023 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Time/Retired for the BMW Sauber, and Nick Heidfeld?
| SELECT "Time/Retired" FROM table_38023 WHERE "Constructor" = 'bmw sauber' AND "Driver" = 'nick heidfeld' | wikisql |
CREATE TABLE table_name_91 (
nfl_team VARCHAR,
position VARCHAR,
round VARCHAR,
overall VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which NFL team chose a position of DE when the pick was larger than 9, after round 5, and the ove... | SELECT nfl_team FROM table_name_91 WHERE overall > 118 AND pick > 9 AND round > 5 AND position = "de" | sql_create_context |
CREATE TABLE table_51009 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team when the Tie no was 34?
| SELECT "Away team" FROM table_51009 WHERE "Tie no" = '34' | wikisql |
CREATE TABLE table_75032 (
"Call sign" text,
"Analog channel" text,
"Digital channel" text,
"Virtual channel" text,
"Network" text,
"Station Ownership" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Network of nbc is what digital channel?
| SELECT "Digital channel" FROM table_75032 WHERE "Network" = 'nbc' | wikisql |
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 T1.Price, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
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 procedures_icd (
row_id number,
subject_id number,
... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95909) AND prescriptions.route = 'pr' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-164 month') ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_71584 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money (US$)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Arnold Palmer's score in the tournamnet?
| SELECT "Score" FROM table_71584 WHERE "Player" = 'arnold palmer' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskStates (
Id number,
... | SELECT COUNT(*) FROM Posts AS p WHERE p.CreationDate >= '2019-09-05' | sede |
CREATE TABLE table_21708 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different part 3 verbs are there that mean to freeze?
| SELECT COUNT("Part 3") FROM table_21708 WHERE "Verb meaning" = 'to freeze' | wikisql |
CREATE TABLE table_300283_1 (
official_name VARCHAR,
name_in_spanish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the official name of the municipality whose name in Spanish is Crip n?
| SELECT official_name FROM table_300283_1 WHERE name_in_spanish = "Cripán" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text... | SELECT MZBMLX, MZZDBM, MZZDMC FROM zyjzjlb WHERE JZLSH = '09590061301' | css |
CREATE TABLE table_59595 (
"Rank" text,
"County" text,
"State" text,
"Land area (km\u00b2)" text,
"Land area (mi\u00b2)" text,
"April 1, 2010 census" text,
"April 1, 2010 density (/km\u00b2)" text,
"April 1, 2010 density (/mi\u00b2)" text,
"July 1, 2010 official estimate" text,
"... | SELECT "July 1, 2011 density (/mi\u00b2)" FROM table_59595 WHERE "July 1, 2010 official estimate" = '800,482' | wikisql |
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT COUNT(DISTINCT cname) FROM tryout | spider |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course (
c... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%GREEKMOD%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | advising |
CREATE TABLE countries (
country_id text,
country_name text,
region_id number
)
CREATE TABLE locations (
location_id number,
street_address text,
postal_code text,
city text,
state_province text,
country_id text
)
CREATE TABLE regions (
region_id number,
region_name text
)
... | SELECT department_id, AVG(salary) FROM employees WHERE commission_pct <> "null" GROUP BY department_id | spider |
CREATE TABLE table_name_69 (
date_of_appointment VARCHAR,
outgoing_manager VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Date of Appointment, when Outgoing Manager is 'Giray Bulak'?
| SELECT date_of_appointment FROM table_name_69 WHERE outgoing_manager = "giray bulak" | sql_create_context |
CREATE TABLE table_25800134_1 (
series__number INTEGER,
airdate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is largest series number for the episode that aired February 16, 1957?
| SELECT MAX(series__number) FROM table_25800134_1 WHERE airdate = "February 16, 1957" | sql_create_context |
CREATE TABLE table_15724 (
"Name" text,
"League" real,
"FA Cup" real,
"League Cup" real,
"Other" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least other for league cup less than 0, FA cup more than 0 and league of 2 wit... | SELECT MIN("Other") FROM table_15724 WHERE "Total" < '14' AND "League" = '2' AND "FA Cup" > '0' AND "League Cup" < '0' | wikisql |
CREATE TABLE table_name_26 (
to_par VARCHAR,
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the to par when the place is t10 and the score is 72-74-71-69=286?
| SELECT to_par FROM table_name_26 WHERE place = "t10" AND score = 72 - 74 - 71 - 69 = 286 | sql_create_context |
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.marital_status = "MARRIED" AND demographic.admityear < "2195" | mimicsql_data |
CREATE TABLE table_name_59 (
record VARCHAR,
opponent VARCHAR,
method VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What record has magomedkhan gamzatkhanov as the opponent, and submission as the method?
| SELECT record FROM table_name_59 WHERE opponent = "magomedkhan gamzatkhanov" AND method = "submission" | sql_create_context |
CREATE TABLE table_train_144 (
"id" int,
"retinal_dystrophy" bool,
"mini_mental_state_examination_mmse" int,
"memory_box" float,
"body_weight" float,
"neutrophil_count" int,
"moca_score" int,
"severe_dementia" bool,
"dementia" bool,
"macular_degeneration" bool,
"diabetic_reti... | SELECT * FROM table_train_144 WHERE dementia = 1 AND (moderate_dementia = 1 OR severe_dementia = 1) OR (moca_score < 17 OR mini_mental_state_examination_mmse < 17) | criteria2sql |
CREATE TABLE table_name_26 (
flight VARCHAR,
aircraft VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which flight had an aircraft of vickers viscount type 794?
| SELECT flight FROM table_name_26 WHERE aircraft = "vickers viscount type 794" | sql_create_context |
CREATE TABLE table_name_12 (
goals_per_match VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Cha Bum-Kun's average number of goals per match?
| SELECT COUNT(goals_per_match) FROM table_name_12 WHERE name = "cha bum-kun" | sql_create_context |
CREATE TABLE table_32376 (
"Season" text,
"Team" text,
"League Apps" real,
"League Goals" real,
"Cup Apps" real,
"Cup Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many league apps in the season with more than 2 cup goals and more th... | SELECT SUM("League Apps") FROM table_32376 WHERE "Cup Goals" > '2' AND "Cup Apps" > '6' | wikisql |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id ... | SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' | advising |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31260) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', prescriptions.startdate) = '08' | mimic_iii |
CREATE TABLE table_19130829_4 (
team__number2 VARCHAR,
team__number1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's team #2 in the round where team $1 is Ilisiakos?
| SELECT team__number2 FROM table_19130829_4 WHERE team__number1 = "Ilisiakos" | sql_create_context |
CREATE TABLE table_17062 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"MLB Draft" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many schools did Mike Jones attend?
| SELECT COUNT("School") FROM table_17062 WHERE "Player" = 'Mike Jones' | wikisql |
CREATE TABLE Bookings (
booking_id INTEGER,
customer_id INTEGER,
booking_status_code VARCHAR(10),
returned_damaged_yn VARCHAR(40),
booking_start_date DATETIME,
booking_end_date DATETIME,
count_hired VARCHAR(40),
amount_payable DECIMAL(19,4),
amount_of_discount DECIMAL(19,4),
amou... | SELECT first_name, gender_mf FROM Customers WHERE good_or_bad_customer = 'good' ORDER BY gender_mf | nvbench |
CREATE TABLE table_39123 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest position of the team with a... | SELECT MAX("Position") FROM table_39123 WHERE "Against" = '12' AND "Points" < '11' AND "Drawn" > '2' AND "Played" > '9' | wikisql |
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 jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '25783022508' AND jybgb.KSMC LIKE '%内镜%' | css |
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 vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND NOT vitalperiodic.sao2 IS NULL AND ... | eicu |
CREATE TABLE table_2589 (
"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's the season number of... | SELECT MIN("No. in season") FROM table_2589 WHERE "No. in series" = '84' | wikisql |
CREATE TABLE table_name_14 (
category VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What category was in 1964?
| SELECT category FROM table_name_14 WHERE year = 1964 | sql_create_context |
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 (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '方芳芳' AND wdmzjzjlb.JZKSRQ BETWEEN '2000-02-04' AND '2011-08-12' UNION SELECT COUNT(*) FROM p... | css |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51858) AND prescriptions.drug = 'felodipine' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-12' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purc... | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAN... | atis |
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 SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '魏初雪' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2004-09-03' AND '2009-03-08' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' | css |
CREATE TABLE table_25580292_13 (
aggressive_rider VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the aggressive rider when the winner was luis le n s nchez?
| SELECT aggressive_rider FROM table_25580292_13 WHERE winner = "Luis León Sánchez" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-87703')) AND diagnosis.diagnosisname = 'respiratory acidosis'... | eicu |
CREATE TABLE table_58049 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the game held when the home team score... | SELECT "Venue" FROM table_58049 WHERE "Home team score" = '12.21 (93)' | wikisql |
CREATE TABLE table_40680 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of rank when gold is 2 and total is more than 4?
| SELECT SUM("Rank") FROM table_40680 WHERE "Gold" = '2' AND "Total" > '4' | wikisql |
CREATE TABLE table_name_7 (
position VARCHAR,
height VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Position of the player with a Height off 188cm?
| SELECT position FROM table_name_7 WHERE height = "188cm" | sql_create_context |
CREATE TABLE table_name_56 (
language VARCHAR,
year VARCHAR,
role VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What language is spoken after 2007 for the role of urvashi mathur?
| SELECT language FROM table_name_56 WHERE year > 2007 AND role = "urvashi mathur" | sql_create_context |
CREATE TABLE table_227 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"TV" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the week where att... | SELECT "Week" FROM table_227 WHERE "Attendance" = '77,098' | wikisql |
CREATE TABLE table_name_46 (
team_chassis VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Team/Chassis has a Year larger than 1987?
| SELECT team_chassis FROM table_name_46 WHERE year > 1987 | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutpu... | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) AND microlab.culturesite = 'urine, voided specimen' AND STRF... | eicu |
CREATE TABLE table_1416 (
"Country" text,
"Freedom in the World 2013" text,
"2013 Index of Economic Freedom" text,
"2013 Press Freedom Index" text,
"2012 Democracy Index" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many freedom indices does t... | SELECT COUNT("2013 Press Freedom Index") FROM table_1416 WHERE "Country" = 'Austria' | wikisql |
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 jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info... | css |
CREATE TABLE table_47057 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the golfer from the country of fiji?
| SELECT COUNT("Score") FROM table_47057 WHERE "Country" = 'fiji' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE 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 prescriptions.formulary_drug_cd = "ROSI8" | mimicsql_data |
CREATE TABLE table_12327 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is Eduardo Romero from?
| SELECT "Country" FROM table_12327 WHERE "Player" = 'eduardo romero' | wikisql |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 GROUP BY date ORDER BY date | nvbench |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy... | css |
CREATE TABLE table_name_93 (
school_club_team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Michael Stewart's school or club team?
| SELECT school_club_team FROM table_name_93 WHERE player = "michael stewart" | sql_create_context |
CREATE TABLE table_29273182_1 (
title VARCHAR,
no_in_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of episode number 29 in the series?
| SELECT title FROM table_29273182_1 WHERE no_in_series = 29 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_name_26 (
attendance INTEGER,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Attendance, when Home Team is 'Welling United'?
| SELECT MIN(attendance) FROM table_name_26 WHERE home_team = "welling united" | sql_create_context |
CREATE TABLE table_15652027_1 (
extortion_theft_3 VARCHAR,
united_nations_mission VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the extortion and theft rates where the United Nations Observer Mission Uganda-Rwanda is active?
| SELECT extortion_theft_3 FROM table_15652027_1 WHERE united_nations_mission = "United Nations Observer Mission Uganda-Rwanda" | sql_create_context |
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 patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '012-39576' AND STRFTIME('%y', patient.hospitaldischargetime) = '2102' ORDER BY patient.hospitaldischargetime LIMIT 1 | eicu |
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 demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Maalox/Diphenhydramine/Lidocaine" AND prescriptions.route = "PO" | mimicsql_data |
CREATE TABLE table_55106 (
"Team" text,
"City/Area" text,
"Arena" text,
"Capacity" text,
"Last season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which arena has a capactiy of 1,100?
| SELECT "Arena" FROM table_55106 WHERE "Capacity" = '1,100' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '苗飞章' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2015-03-03' AND '2015-09-01' | css |
CREATE TABLE Stores (
Store_ID VARCHAR(100),
Address_ID INTEGER,
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Products (
Product_ID VARCHAR(100),
Product_Name VARCHAR(25... | SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY COUNT(Service_Type_Description) DESC | nvbench |
CREATE TABLE table_22297198_3 (
replaced_by VARCHAR,
date_of_vacancy VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the replacement manager for the vacancy of 12 Dec 2009?
| SELECT replaced_by FROM table_22297198_3 WHERE date_of_vacancy = "12 Dec 2009" | sql_create_context |
CREATE TABLE table_name_89 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did Collingwood play at home?
| SELECT home_team FROM table_name_89 WHERE away_team = "collingwood" | sql_create_context |
CREATE TABLE table_13643320_2 (
rnd VARCHAR,
gtp_winning_team VARCHAR,
gto_winning_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What us the number of the round during which #56 Blue Thunder Racing become the GTP winning team and #38 Mandeville Aut... | SELECT rnd FROM table_13643320_2 WHERE gtp_winning_team = "#56 Blue Thunder Racing" AND gto_winning_team = "#38 Mandeville Auto Tech" | 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_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '22354212' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 4694.23) | css |
CREATE TABLE table_name_13 (
agg VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1st leg of the team with a 2-1 agg.?
| SELECT 1 AS st_leg FROM table_name_13 WHERE agg = "2-1" | sql_create_context |
CREATE TABLE table_3202 (
"Team" text,
"#" real,
"Car Sponsor(s)" text,
"Driver(s)" text,
"Listed Owner(s)" text,
"Engine" text,
"Chassis" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the driver of the Chevrolet engine that is spons... | SELECT "Driver(s)" FROM table_3202 WHERE "Engine" = 'Chevrolet' AND "Car Sponsor(s)" = 'GoDaddy.com' | wikisql |
CREATE TABLE table_58776 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Time/Retired has Laps smaller than 14, and a Rider of darren barton?
| SELECT "Time/Retired" FROM table_58776 WHERE "Laps" < '14' AND "Rider" = 'darren barton' | wikisql |
CREATE TABLE table_43835 (
"Date" text,
"Opponent" text,
"Site" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent when they played at the legion field birmingham, al site?
| SELECT "Opponent" FROM table_43835 WHERE "Site" = 'legion field • birmingham, al' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.