instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_7 (
july VARCHAR,
october VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is in July where October is jill de vries?
| SELECT july FROM table_name_7 WHERE october = "jill de vries" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID | nvbench |
CREATE TABLE table_80012 (
"Year" real,
"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 men's doubles the year Pernille Nederg... | SELECT "Men's doubles" FROM table_80012 WHERE "Women's singles" = 'pernille nedergaard' | wikisql |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200 ORDER BY SUM(ID) DESC | nvbench |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)... | SELECT Id AS "post_link", Body FROM Posts WHERE Body LIKE '%$%$%' | sede |
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 SUM(UpVotes) AS "Upvotes", SUM(DownVotes) AS "Downvotes", SUM(DownVotes) * 100 / (SUM(UpVotes) + SUM(DownVotes)) AS "Downvote %" FROM Users | sede |
CREATE TABLE market (
Market_ID int,
Country text,
Number_cities int
)
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID ... | SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY Studio | nvbench |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | SELECT COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '2003934' AND zyjybgb.BGRQ BETWEEN '2012-08-24' AND '2015-07-31' GROUP BY zyjybgb.KSBM HAVING COUNT(*) <= 12 UNION SELECT mzjybgb.KSBM FROM mzjz... | css |
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE student (
... | SELECT year, COUNT(*) FROM section GROUP BY semester, year ORDER BY year | nvbench |
CREATE TABLE table_6735 (
"Rank" real,
"Goalkeeper" text,
"Club" text,
"MINS" real,
"SHTS" real,
"W-L-T" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the club for the 132 SHTS?
| SELECT "Club" FROM table_6735 WHERE "SHTS" = '132' | 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 jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN 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 jybg... | css |
CREATE TABLE table_name_71 (
tuesday VARCHAR,
thursday VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is shown on Tuesday when Thursday shows Fox Sports Tonight (ends 1 am next day)?
| SELECT tuesday FROM table_name_71 WHERE thursday = "fox sports tonight (ends 1 am next day)" | sql_create_context |
CREATE TABLE table_27631002_1 (
season VARCHAR,
f_laps VARCHAR,
races VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which season had f/laps is 0 and races is 2?
| SELECT season FROM table_27631002_1 WHERE f_laps = 0 AND races = 2 | sql_create_context |
CREATE TABLE mill (
architect_id number,
id number,
location text,
name text,
type text,
built_year number,
notes text
)
CREATE TABLE bridge (
architect_id number,
id number,
name text,
location text,
length_meters number,
length_feet number
)
CREATE TABLE architect... | SELECT DISTINCT T1.name FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id JOIN bridge AS T3 ON T3.architect_id = T2.id WHERE T3.length_meters > 80 | spider |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'prt lg intes exc nec/nos') AND DATETIME(procedures_i... | mimic_iii |
CREATE TABLE table_25254 (
"Stage" real,
"Winner" text,
"General Classification" text,
"Mountains Classification" text,
"Sprint Classification" text,
"Team Classification" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most stage for al... | SELECT MAX("Stage") FROM table_25254 WHERE "General Classification" = 'Alejandro Valverde' AND "Team Classification" = 'Astana' AND "Winner" = 'Greg Henderson' | wikisql |
CREATE TABLE basketball_match (
team_id number,
school_id number,
team_name text,
acc_regular_season text,
acc_percent text,
acc_home text,
acc_road text,
all_games text,
all_games_percent number,
all_home text,
all_road text,
all_neutral text
)
CREATE TABLE university (... | SELECT COUNT(DISTINCT school_id) FROM basketball_match | spider |
CREATE TABLE table_63684 (
"Position" text,
"Appearances" real,
"Goals" real,
"First appearance" real,
"Last appearance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average goals when the last appearance was before 1984, there were mo... | SELECT AVG("Goals") FROM table_63684 WHERE "Last appearance" < '1984' AND "Appearances" > '17' AND "First appearance" < '1961' AND "Position" = 'mf' | wikisql |
CREATE TABLE table_name_13 (
on_air_id VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the On-air ID of the broadcaster at frequency 0 801?
| SELECT on_air_id FROM table_name_13 WHERE frequency = "0 801" | 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.insurance = "Medicaid" AND demographic.admityear < "2103" | mimicsql_data |
CREATE TABLE table_45522 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Tom Harkin" text,
"Republican: Christopher Reed" text,
"Lead Margin" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Democrat: Tom Harkin's percentage when ... | SELECT "Democrat: Tom Harkin" FROM table_45522 WHERE "Poll Source" = 'rasmussen reports' AND "Lead Margin" = '14' | wikisql |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No... | SELECT County, COUNT(County) FROM appellations GROUP BY County ORDER BY County | nvbench |
CREATE TABLE table_26842217_18 (
time VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the time for result msst 29 24
| SELECT time FROM table_26842217_18 WHERE result = "MSST 29–24" | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
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 month (
... | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'BALTIMORE' AND ground_service.airport_code = airport.airport_code AND ground_service.transport_... | atis |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT department, name, number FROM course WHERE credits = 13 AND department = 'RELIGION' AND number < 200 + 100 AND number >= 200 | advising |
CREATE TABLE table_name_40 (
team VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team was in 1951?
| SELECT team FROM table_name_40 WHERE year = 1951 | 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 MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear >= "2177" | mimicsql_data |
CREATE TABLE ship (
Name VARCHAR,
Tonnage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the ship with the largest tonnage?
| SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1 | sql_create_context |
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 STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-82318') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE table_10402018_1 (
toronto___broadway VARCHAR,
uk_tour VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which person is in the tronto/broadway and has a uk tour of n/a
| SELECT toronto___broadway FROM table_10402018_1 WHERE uk_tour = "n/a" | sql_create_context |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE restriction (
... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PHILADELPHIA' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId numbe... | SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", PostNotices.CreationDate AS BountyPosted, Posts.CreationDate AS AnswerPosted FROM PostNotices JOIN Posts ON PostNotices.PostId = Posts.ParentId WHERE PostNotices.PostNoticeTypeId = 15 AND PostNotices.CreationDate < Posts.CreationDate ORDER BY Posts.Creat... | sede |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | SELECT FIRST_NAME, MANAGER_ID FROM employees ORDER BY MANAGER_ID DESC | nvbench |
CREATE TABLE table_10667 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many laps have a time/retired of +1 lap and mark blundell is the driver?
| SELECT AVG("Laps") FROM table_10667 WHERE "Time/Retired" = '+1 lap' AND "Driver" = 'mark blundell' | wikisql |
CREATE TABLE table_61435 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player is on the roster for the Sydney University Lions?
| SELECT "Name" FROM table_61435 WHERE "Club" = 'sydney university lions' | wikisql |
CREATE TABLE table_77212 (
"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 the place of player tom watson?
| SELECT "Place" FROM table_77212 WHERE "Player" = 'tom watson' | wikisql |
CREATE TABLE table_49920 (
"Outcome" text,
"Date" text,
"Location" text,
"Surface" text,
"Partnering" text,
"Opponent in final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Outcome is 'winner', when Partne... | SELECT "Score" FROM table_49920 WHERE "Outcome" = 'winner' AND "Partnering" = 'nicole sewell' AND "Opponent in final" = 'victoria davies / kate warne-holland' | 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 SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '邹学博' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-04-09' AND '2014-05-05' | css |
CREATE TABLE table_26593762_3 (
position_in_table VARCHAR,
outgoing_manager VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the table position for the team whose outgoing manager was Brian Laws?
| SELECT position_in_table FROM table_26593762_3 WHERE outgoing_manager = "Brian Laws" | sql_create_context |
CREATE TABLE table_76266 (
"Governorate" text,
"Capital City" text,
"Area km\u00b2" real,
"Pop (2004)" real,
"Map Key" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the amount of Map Key which has a Pop (2004) smaller than 433,819, and a Capit... | SELECT AVG("Map Key") FROM table_76266 WHERE "Pop (2004)" < '433,819' AND "Capital City" = 'hajjah' AND "Area km\u00b2" < '9,376' | wikisql |
CREATE TABLE table_12886178_4 (
tries_against VARCHAR,
tries_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the tries against count for the club whose tries for count was 29?
| SELECT tries_against FROM table_12886178_4 WHERE tries_for = "29" | sql_create_context |
CREATE TABLE table_272865_20 (
years_active VARCHAR,
asian_cup_played_as_a_captain VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the years active where Asian Cup played as a captain is Iran 1976?
| SELECT years_active FROM table_272865_20 WHERE asian_cup_played_as_a_captain = "Iran 1976" | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_name_40 (
muzzle_energy VARCHAR,
max_pressure VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the muzzle energy with 40,000 psi max pressure?
| SELECT muzzle_energy FROM table_name_40 WHERE max_pressure = "40,000 psi" | sql_create_context |
CREATE TABLE table_50896 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city or state contains Calder Park Raceway?
| SELECT "City / State" FROM table_50896 WHERE "Circuit" = 'calder park raceway' | wikisql |
CREATE TABLE table_name_99 (
engine VARCHAR,
entrant VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which engine did Marlboro Team Alfa Romeo used with a chassis of alfa romeo 179?
| SELECT engine FROM table_name_99 WHERE entrant = "marlboro team alfa romeo" AND chassis = "alfa romeo 179" | sql_create_context |
CREATE TABLE table_65504 (
"President" text,
"Schl. 1948" text,
"Schl. 1962" text,
"M-B 1982" text,
"CT 1982" text,
"Siena 1982" text,
"Siena 1990" text,
"Siena 1994" text,
"R-McI 1996" text,
"Schl. 1996" text,
"C-SPAN 1999" text,
"WSJ 2000" text,
"Siena 2002" text,
... | SELECT "C-SPAN 2009" FROM table_65504 WHERE "Times 2008**" = '08' | wikisql |
CREATE TABLE table_2886617_3 (
pick VARCHAR,
nationality VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many picks have canada as the nationality and larry courville is the player?
| SELECT COUNT(pick) FROM table_2886617_3 WHERE nationality = "Canada" AND player = "Larry Courville" | sql_create_context |
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 WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "24" | mimicsql_data |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instruc... | SELECT DISTINCT total_credit FROM student WHERE student_id = 1 | advising |
CREATE TABLE table_name_67 (
state VARCHAR,
net_contribution_per_capita VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What state has a Net contribution per capita of $-171?
| SELECT state FROM table_name_67 WHERE net_contribution_per_capita = "$-171" | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
CREATE TABLE table_name_11 (
knots VARCHAR,
ship VARCHAR,
passengers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many knots did the Ms Moby Vincent have when passengers was less than 1.6?
| SELECT COUNT(knots) FROM table_name_11 WHERE ship = "ms moby vincent" AND passengers < 1.6 | sql_create_context |
CREATE TABLE table_9670 (
"Team" text,
"Average" real,
"Points" real,
"Played" real,
"1992-93" text,
"1993-94" text,
"1994-1995" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest 1994-1995, when Points is 145, and when Played... | SELECT MIN("1994-1995") FROM table_9670 WHERE "Points" = '145' AND "Played" < '114' | wikisql |
CREATE TABLE table_24330 (
"Season" real,
"Episode" real,
"Episode Summary" text,
"Premier date" text,
"External Link" text,
"Coach" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the season for august 16, 2010
| SELECT "Season" FROM table_24330 WHERE "Premier date" = 'August 16, 2010' | wikisql |
CREATE TABLE table_46618 (
"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.
-- How many ties occurred with a score of 2 2?
| SELECT "Tie no" FROM table_46618 WHERE "Score" = '2–2' | wikisql |
CREATE TABLE table_name_45 (
venue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue of the match on 5 April 2000?
| SELECT venue FROM table_name_45 WHERE date = "5 april 2000" | sql_create_context |
CREATE TABLE table_47247 (
"Game" real,
"Date" text,
"Score" text,
"Location" text,
"Time" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did a game have a time of 3:44?
| SELECT "Date" FROM table_47247 WHERE "Time" = '3:44' | wikisql |
CREATE TABLE table_39364 (
"Date" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is The Opponents of lincoln city and a H / A of a?
| SELECT "Date" FROM table_39364 WHERE "Opponents" = 'lincoln city' AND "H / A" = 'a' | wikisql |
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 ReviewTaskResultTypes (
Id number,
Na... | SELECT TagName, COUNT(*) AS cnt FROM (SELECT p.Id, T.TagName FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId) AS t1 GROUP BY TagName ORDER BY cnt DESC | sede |
CREATE TABLE table_55492 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the time/retired for riccardo patrese
| SELECT "Time/Retired" FROM table_55492 WHERE "Driver" = 'riccardo patrese' | wikisql |
CREATE TABLE table_name_77 (
main_use VARCHAR,
year VARCHAR,
town VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the main use of the structure that was in redfield, arkansas before 2004?
| SELECT main_use FROM table_name_77 WHERE year < 2004 AND town = "redfield, arkansas" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
... | SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4469 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND outputevents.itemid I... | mimic_iii |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid... | 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 = 'intraaortic balloon pump removal' AND ST... | eicu |
CREATE TABLE table_11702 (
"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.
-- When did the home team score 12.17 (89)?
| SELECT "Date" FROM table_11702 WHERE "Home team score" = '12.17 (89)' | wikisql |
CREATE TABLE table_60691 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To Par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Player has a To Par smaller than 5, and a Score of 70-72=142?
| SELECT "Player" FROM table_60691 WHERE "To Par" < '5' AND "Score" = '70-72=142' | wikisql |
CREATE TABLE school (
school_id number,
grade text,
school text,
location text,
type text
)
CREATE TABLE school_bus (
school_id number,
driver_id number,
years_working number,
if_full_time others
)
CREATE TABLE driver (
driver_id number,
name text,
party text,
home_... | SELECT party FROM driver WHERE home_city = 'Hartford' AND age > 40 | spider |
CREATE TABLE table_19948664_2 (
index__year_ VARCHAR,
world_ranking__1_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years were recorded when world ranking was 21st?
| SELECT COUNT(index__year_) FROM table_19948664_2 WHERE world_ranking__1_ = "21st" | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Buddhism%' OR course.description LIKE '%Buddhism%' OR course.name LIKE '%Buddhism%') AND course.enforced_requirement = 'N / A' | advising |
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE reviewer (
rid number,
name text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT mid FROM rating EXCEPT SELECT T1.mid FROM rating AS T1 JOIN reviewer AS T2 ON T1.rid = T2.rid WHERE T2.name = "Brittany Harris" | spider |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
Rejection... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id = p.Own... | sede |
CREATE TABLE table_39752 (
"Office" text,
"Democratic ticket" text,
"Republican ticket" text,
"Socialist ticket" text,
"Workers ticket" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name on the Democratic ticket when the Workers ticket ... | SELECT "Democratic ticket" FROM table_39752 WHERE "Workers ticket" = 'james p. cannon' | wikisql |
CREATE TABLE table_204_642 (
id number,
"team" text,
"domestic tournament" text,
"position" text,
"appearance" text,
"qualified" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which teams were the last to qualify ?
| SELECT "team" FROM table_204_642 WHERE "qualified" = (SELECT MAX("qualified") FROM table_204_642) | squall |
CREATE TABLE table_203_872 (
id number,
"year" number,
"location(s)" text,
"number of contestants" number,
"ladies winner" text,
"men's winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the first winner men 's winner , in 1965 ?
| SELECT "men's winner" FROM table_203_872 WHERE "year" = 1965 | squall |
CREATE TABLE table_73479 (
"Player" text,
"Games Played" real,
"Minutes" real,
"Field Goals" real,
"Three Pointers" real,
"Free Throws" real,
"Rebounds" real,
"Assists" real,
"Blocks" real,
"Steals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions... | SELECT MIN("Three Pointers") FROM table_73479 WHERE "Steals" = '52' | wikisql |
CREATE TABLE table_61302 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue has more than 9 against and a status of second test?
| SELECT "Venue" FROM table_61302 WHERE "Against" > '9' AND "Status" = 'second test' | 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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '75810879' AND t_kc21.MED_SER_ORG_NO = '2045056' AND t_kc21.OUT_DIAG_DIS_NM LIKE '%皮炎%' | css |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | SELECT t3.labname FROM (SELECT t2.labname, 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 = 'alpha/beta blocker' AND DATETIME(treatment.treatment... | eicu |
CREATE TABLE table_52650 (
"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 did Hawthorn have their away match against... | SELECT "Venue" FROM table_52650 WHERE "Away team" = 'hawthorn' | wikisql |
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 * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '杨凌霜' AND hz_info.YLJGDM = '7646173' AND zyjzjlb.JZKSMC LIKE '%骨肿瘤%' | css |
CREATE TABLE table_name_51 (
year INTEGER,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the earliest year that the result 21-17?
| SELECT MIN(year) FROM table_name_51 WHERE result = "21-17" | sql_create_context |
CREATE TABLE sqlite_sequence (
name text,
seq text
)
CREATE TABLE country (
id number,
name text
)
CREATE TABLE player_attributes (
id number,
player_fifa_api_id number,
player_api_id number,
date text,
overall_rating number,
potential number,
preferred_foot text,
attac... | SELECT DISTINCT T1.player_name, T1.birthday FROM player AS T1 JOIN player_attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY potential DESC LIMIT 5 | spider |
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE field (
fieldid int... | SELECT DISTINCT cite.citingpaperid FROM cite, paper WHERE paper.paperid = cite.citedpaperid GROUP BY cite.citingpaperid HAVING COUNT(DISTINCT cite.citedpaperid) > 10 | scholar |
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_NM = '云鸿光' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT MED_ORG_DEPT_CD, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '7124001' GROUP BY MED_ORG_DEPT_CD, OUT_DIAG_DIS_NM | css |
CREATE TABLE table_3227 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What CFL team got their draft pick from North Dakota?
| SELECT "CFL Team" FROM table_3227 WHERE "College" = 'North Dakota' | wikisql |
CREATE TABLE table_46683 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Opponents, when Partner is Mervana Jugi -Salki ?
| SELECT "Opponents" FROM table_46683 WHERE "Partner" = 'mervana jugić-salkić' | 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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "31" AND procedures.long_title = "Insertion of endotracheal tube" | mimicsql_data |
CREATE TABLE table_name_30 (
opponent VARCHAR,
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Result of 1 1, and a Date of 28 november 1998?
| SELECT opponent FROM table_name_30 WHERE result = "1–1" AND date = "28 november 1998" | sql_create_context |
CREATE TABLE table_56528 (
"Year" text,
"Starts" real,
"Cuts made" real,
"Wins" real,
"Top 10" real,
"Top 25" real,
"Earnings ($)" real,
"Money list rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year has a Top 25 of 0, and a ... | SELECT "Year" FROM table_56528 WHERE "Top 25" = '0' AND "Earnings ($)" > '0' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '93948131621' AND HOSP_DOC_NM LIKE '苗%' | css |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostHistory (
Id number,
... | SELECT Id AS "post_link", Title AS "post_title", Body AS "post_body", Score AS "vote_count" FROM Posts WHERE NOT ClosedDate IS NULL AND Title LIKE '%minecraft%' AND Score < 0 | sede |
CREATE TABLE table_23248967_10 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the final score of the game on April 9?
| SELECT score FROM table_23248967_10 WHERE date = "April 9" | sql_create_context |
CREATE TABLE table_80036 (
"Country" text,
"Film title used in nomination" text,
"Language" text,
"Original name" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of the German film that is originally called Mama, Ic... | SELECT "Film title used in nomination" FROM table_80036 WHERE "Language" = 'german' AND "Original name" = 'mama, ich lebe' | wikisql |
CREATE TABLE table_32584 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average overall rank of all players drafted from Duke after round 9?
| SELECT AVG("Overall") FROM table_32584 WHERE "School/Club Team" = 'duke' AND "Round" > '9' | wikisql |
CREATE TABLE table_name_62 (
date VARCHAR,
time VARCHAR,
set_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Time of 11:00, and a Set 3 of 25 18?
| SELECT date FROM table_name_62 WHERE time = "11:00" AND set_3 = "25–18" | sql_create_context |
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
CREATE TABLE employee (
emp_num number,
emp_lname ... | SELECT COUNT(*) FROM class AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting' | spider |
CREATE TABLE table_25691838_6 (
the_wørd VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was The Word for production code 6084?
| SELECT the_wørd FROM table_25691838_6 WHERE production_code = 6084 | sql_create_context |
CREATE TABLE table_38997 (
"Jyutping" text,
"Character" text,
"Portuguese" text,
"Relative value" text,
"Metric value" text,
"Imperial value" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the imperial that contains a jyutping of cin4?
| SELECT "Imperial value" FROM table_38997 WHERE "Jyutping" = 'cin4' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.