instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_86 (
miss_universe_philippines VARCHAR,
second_runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won Miss Universe Philippines when Regina Hahn was second runner-up?
| SELECT miss_universe_philippines FROM table_name_86 WHERE second_runner_up = "regina hahn" | sql_create_context |
CREATE TABLE table_41961 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the tournament played on Jul 4, 1982, what was the winning score?
| SELECT "Winning score" FROM table_41961 WHERE "Date" = 'jul 4, 1982' | wikisql |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY DESC | nvbench |
CREATE TABLE table_name_28 (
tie_no VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the tie no that has southport as the away team?
| SELECT tie_no FROM table_name_28 WHERE away_team = "southport" | sql_create_context |
CREATE TABLE table_53578 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was t... | SELECT "Fastest lap" FROM table_53578 WHERE "Race" = 'belgian grand prix' | wikisql |
CREATE TABLE table_68024 (
"Team" text,
"Truck(s)" text,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Owner(s)" text,
"Crew Chief" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the driver that has a crew chief Gary Ritter?
| SELECT "Driver(s)" FROM table_68024 WHERE "Crew Chief" = 'gary ritter' | wikisql |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varch... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BALTIMORE' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_6513 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the year that has points larger than 20?
| SELECT COUNT("Year") FROM table_6513 WHERE "Points" > '20' | wikisql |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(HIRE_DATE) DESC | nvbench |
CREATE TABLE table_50305 (
"Release" real,
"Start" text,
"Pieces" real,
"Board (inches)" text,
"Board (cm)" text,
"Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the dimensions in centimeters of a theater board who started in 1940,... | SELECT "Board (cm)" FROM table_50305 WHERE "Start" = '1940' AND "Type" = 'theater' AND "Release" > '2010' | wikisql |
CREATE TABLE table_name_35 (
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the home team score for south melbourne home team
| SELECT home_team AS score FROM table_name_35 WHERE home_team = "south melbourne" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "7" AND procedures.icd9_code = "4576" | mimicsql_data |
CREATE TABLE table_77083 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Player who has a To par of 2 and a Score of 69-73=142?
| SELECT "Player" FROM table_77083 WHERE "To par" = '–2' AND "Score" = '69-73=142' | wikisql |
CREATE TABLE table_35630 (
"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 Total is the highest one that has a Rank of 1, and a Gold larger than 11?
| SELECT MAX("Total") FROM table_35630 WHERE "Rank" = '1' AND "Gold" > '11' | wikisql |
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_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id numbe... | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_id FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FRO... | mimic_iii |
CREATE TABLE table_14871601_1 (
losses INTEGER,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest loss for the Tacuary team?
| SELECT MAX(losses) FROM table_14871601_1 WHERE team = "Tacuary" | sql_create_context |
CREATE TABLE table_name_96 (
director VARCHAR,
producer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the director for the film produced by River Films?
| SELECT director FROM table_name_96 WHERE producer = "river films" | sql_create_context |
CREATE TABLE table_4165 (
"No. in series" 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.
-- How many millions ... | SELECT "U.S. viewers (million)" FROM table_4165 WHERE "Title" = 'Miss Mystic Falls' | wikisql |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Urinary incontinence, unspecified" | mimicsql_data |
CREATE TABLE table_name_73 (
actor VARCHAR,
character VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What actor plays Marie-Rose De Putter?
| SELECT actor FROM table_name_73 WHERE character = "marie-rose de putter" | sql_create_context |
CREATE TABLE table_2509350_3 (
language VARCHAR,
el_villar_municipality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the language for el villar 1264
| SELECT language FROM table_2509350_3 WHERE el_villar_municipality = 1264 | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.days_stay > "10" | mimicsql_data |
CREATE TABLE table_204_480 (
id number,
"title" text,
"alternate title(s)" text,
"year" number,
"manufacturer" text,
"genre(s)" text,
"max. players" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which manufacturer has the most games on th... | SELECT "manufacturer" FROM table_204_480 GROUP BY "manufacturer" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jyjgzbb.JCFF 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 = jyjgzbb.BGDH WHERE hz_in... | css |
CREATE TABLE table_27382 (
"Language" text,
"Punata Municipality" real,
"Villa Rivero Municipality" real,
"San Benito Municipality" real,
"Tacachi Municipality" real,
"Cuchumuela Municipality" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If Vi... | SELECT "Language" FROM table_27382 WHERE "Villa Rivero Municipality" = '7' | wikisql |
CREATE TABLE table_name_61 (
venue VARCHAR,
player VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Venue has michael di venuto on Season of 2000/01?
| SELECT venue FROM table_name_61 WHERE player = "michael di venuto" AND season = "2000/01" | sql_create_context |
CREATE TABLE Students (
student_id VARCHAR,
first_name VARCHAR
)
CREATE TABLE Assessment_Notes (
date_of_notes VARCHAR,
student_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the dates of assessment notes for students with first name 'Fanny'... | SELECT T1.date_of_notes FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = "Fanny" | 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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40059 AND admissions.dischtime IS NULL)) AND transfers.... | mimic_iii |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-9230')) AND lab.labname = 'troponin - i' | eicu |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '82741978' AND t_kc21.MED_SER_ORG_NO = '3317278' AND t_kc21.OUT_DIAG_DIS_NM LIKE '%支气管炎%' | css |
CREATE TABLE student (
id text,
name text,
dept_name text,
tot_cred number
)
CREATE TABLE takes (
id text,
course_id text,
sec_id text,
semester text,
year number,
grade text
)
CREATE TABLE course (
course_id text,
title text,
dept_name text,
credits number
)
C... | SELECT dept_name FROM course GROUP BY dept_name ORDER BY SUM(credits) DESC LIMIT 1 | spider |
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE D... | SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID | nvbench |
CREATE TABLE table_31384 (
"Value" text,
"Dimensions" text,
"Main Color" text,
"Obverse" text,
"Reverse" text,
"Watermark" text,
"Date of issue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is on the reverse side of the 100 coin?
| SELECT "Reverse" FROM table_31384 WHERE "Value" = '₩100' | wikisql |
CREATE TABLE table_39282 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points have an Opponent of vancouver canucks?
| SELECT AVG("Points") FROM table_39282 WHERE "Opponent" = 'vancouver canucks' | wikisql |
CREATE TABLE table_55282 (
"Film title" text,
"Director" text,
"Writer" text,
"Voiced character(s)" text,
"Producer/Executive Producer" text,
"Sound" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which writer had voice characters of JDR, BB, TN... | SELECT "Writer" FROM table_55282 WHERE "Voiced character(s)" = 'jdr, bb, tn, lr, ps' | wikisql |
CREATE TABLE table_name_1 (
valency_change VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHat is the Valency change of associative type?
| SELECT valency_change FROM table_name_1 WHERE type = "associative" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Other chronic pulmonary heart diseases" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolea... | SELECT COUNT(*) FROM Posts WHERE OwnerUserId = 5140781 AND PostTypeId = 2 AND CreationDate BETWEEN '2017-07-01' AND '2017-07-31' | sede |
CREATE TABLE table_name_57 (
series_5 VARCHAR,
series_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who in series 5 corresponds to Deborah Meaden in series 3?
| SELECT series_5 FROM table_name_57 WHERE series_3 = "deborah meaden" | sql_create_context |
CREATE TABLE table_3937 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Title" FROM table_3937 WHERE "Directed by" = 'Michael Pressman' AND "No. in season" < '10.0' | wikisql |
CREATE TABLE table_39751 (
"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_39751 WHERE "Workers ticket" = 'franklin p. brill' | wikisql |
CREATE TABLE table_name_26 (
power VARCHAR,
class VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What power has A as the class, and 93.7 as the frequency?
| SELECT power FROM table_name_26 WHERE class = "a" AND frequency = "93.7" | sql_create_context |
CREATE TABLE table_204_197 (
id number,
"date" text,
"time" text,
"opponent#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many games did the 1993 texas tech football team... | SELECT COUNT(*) FROM table_204_197 WHERE "date" IN (9, 10) | squall |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'digoxin 125 mcg po tabs' AND DATETIME(medication.dr... | eicu |
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 WHERE demographic.diagnosis = "S/P FALL" AND demographic.admityear < "2138" | mimicsql_data |
CREATE TABLE table_2067 (
"Role" text,
"Original Broadway Cast" text,
"Current Broadway Cast" text,
"Original Toronto Cast" text,
"First National Tour Cast" text,
"Original Australian Cast" text,
"Original West End Cast" text,
"Current West End Cast" text,
"Second National Tour Cast"... | SELECT COUNT("Second National Tour Year 2") FROM table_2067 WHERE "Original West End Cast" = 'Oliver Tompsett' | wikisql |
CREATE TABLE table_25792 (
"Rank" real,
"City/Town" text,
"County" text,
"Region/Province" text,
"Population" real,
"Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 20 is the rank and north west is the region/province what is the co... | SELECT "County" FROM table_25792 WHERE "Region/Province" = 'North West' AND "Rank" = '20' | wikisql |
CREATE TABLE table_11835 (
"Name" text,
"Country" text,
"Reign began" text,
"Reign ended" text,
"Length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Whose reign ended in Egypt?
| SELECT "Reign ended" FROM table_11835 WHERE "Country" = 'egypt' | wikisql |
CREATE TABLE table_name_5 (
away_captain VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the away captain when the game was at Adelaide Oval?
| SELECT away_captain FROM table_name_5 WHERE venue = "adelaide oval" | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE" AND procedures.icd9_code = "9907" | mimicsql_data |
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 TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLANDO' AND date_day.day_number = 27 AND date_day.month_number = 12 AND ... | atis |
CREATE TABLE table_name_77 (
score VARCHAR,
losing_team VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has a Losing Team of sydney roosters, and a Total of 88?
| SELECT score FROM table_name_77 WHERE losing_team = "sydney roosters" AND total = 88 | sql_create_context |
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,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varc... | SELECT LAST_NAME, SALARY FROM employees ORDER BY LAST_NAME DESC | nvbench |
CREATE TABLE table_11802 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week has Game site of Candlestic... | SELECT "Week" FROM table_11802 WHERE "Game site" = 'candlestick park' | wikisql |
CREATE TABLE table_name_56 (
location VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What location had the opponent Hiroyuki Abe?
| SELECT location FROM table_name_56 WHERE opponent = "hiroyuki abe" | sql_create_context |
CREATE TABLE table_name_59 (
money___£__ VARCHAR,
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Money ( ) that has the Country of england, and the Player of malcolm mackenzie?
| SELECT money___£__ FROM table_name_59 WHERE country = "england" AND player = "malcolm mackenzie" | sql_create_context |
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_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id ... | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'pantoprazole' AND admissions.subject_id = 18677 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2103-10') AS t1 JOIN (SELECT adm... | mimic_iii |
CREATE TABLE table_name_4 (
Field VARCHAR,
player VARCHAR,
goals VARCHAR,
tries VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of field goals of Denan Kemp, who has more than 4 tries, more than 32 points, ... | SELECT COUNT(Field) AS goals FROM table_name_4 WHERE tries > 4 AND points > 32 AND goals = 0 AND player = "denan kemp" | sql_create_context |
CREATE TABLE table_15218 (
"Field" text,
"Geological Trend" text,
"Reserves" text,
"Discovery" text,
"Operator(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which operator has a Reserve of 100 bbbl?
| SELECT "Operator(s)" FROM table_15218 WHERE "Reserves" = '100 bbbl' | wikisql |
CREATE TABLE table_train_129 (
"id" int,
"cerebral_neoplasia" bool,
"gender" string,
"mini_mental_state_examination_mmse" int,
"multiple_lacunar_infarcts" bool,
"neurodegenerative_disease" bool,
"mri_abnormality" bool,
"nervous_system_functioning" bool,
"head_injury" bool,
"serio... | SELECT * FROM table_train_129 WHERE (gender = 'male' OR gender = 'female') AND age >= 50 AND body_mass_index_bmi >= 18.5 | criteria2sql |
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local... | SELECT time, train_number FROM train WHERE destination = 'Chennai' ORDER BY time | nvbench |
CREATE TABLE table_name_52 (
round INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of rounds that Lance Gibson fought when his record was 1-1?
| SELECT AVG(round) FROM table_name_52 WHERE record = "1-1" | sql_create_context |
CREATE TABLE table_69008 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft (m)" text,
"Floors" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The building with 48 floors has an address in Las Vegas of what?
| SELECT "Street address" FROM table_69008 WHERE "Floors" = '48' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-96048' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient... | eicu |
CREATE TABLE table_1566848_6 (
centerfold_model VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 20 questions when centerfold model is cherie witter
| SELECT 20 AS _questions FROM table_1566848_6 WHERE centerfold_model = "Cherie Witter" | sql_create_context |
CREATE TABLE table_23292220_6 (
episode VARCHAR,
jasons_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the episode(s) that featured Duncan James and Johnny Vegas as Jason's team.
| SELECT episode FROM table_23292220_6 WHERE jasons_team = "Duncan James and Johnny Vegas" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId numb... | SELECT COUNT(Posts.Id) AS NoOfQueAsked, Users.Id FROM Posts, Users WHERE Users.Id = OwnerUserId AND Posts.PostTypeId = 1 GROUP BY Users.Id ORDER BY COUNT(Posts.Id) DESC | sede |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '77127973' AND t_kc21.MED_SER_ORG_NO = '6027111' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%瘙痒症%' | css |
CREATE TABLE table_39209 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Height m ( ft )" text,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Frequency MHz of Trinidad, C... | SELECT "Frequency MHz" FROM table_39209 WHERE "City of license" = 'trinidad, colorado' | wikisql |
CREATE TABLE table_54677 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/junior/club team (league)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player is a centre?
| SELECT "Player" FROM table_54677 WHERE "Position" = 'centre' | wikisql |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '6526650' AND t_kc22.SOC_SRT_DIRE_NM = '蒲地蓝消炎口服液' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '6526650' AND t_kc22.SOC_SRT_DIRE_NM = '蒲地蓝消炎口服液... | css |
CREATE TABLE table_name_7 (
round INTEGER,
time VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average round of the match in the Hero's 9 event with a time of 5:00?
| SELECT AVG(round) FROM table_name_7 WHERE time = "5:00" AND event = "hero's 9" | sql_create_context |
CREATE TABLE table_name_21 (
attendance VARCHAR,
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the phillies 1:15 pm played on April 9, what was the attendance?
| SELECT attendance FROM table_name_21 WHERE opponent = "phillies 1:15 pm" AND date = "april 9" | sql_create_context |
CREATE TABLE table_name_69 (
population__2008_ INTEGER,
created VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest population (2008) created earlier than 1857, and the county was Sinoe?
| SELECT MAX(population__2008_) FROM table_name_69 WHERE created < 1857 AND county = "sinoe" | sql_create_context |
CREATE TABLE table_name_72 (
overall VARCHAR,
name VARCHAR,
pick VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the overall pick number for a draft pick smaller than 9, named buck mystrom from Michigan State college?
| SELECT overall FROM table_name_72 WHERE pick < 9 AND college = "michigan state" AND name = "buck mystrom" | sql_create_context |
CREATE TABLE table_name_53 (
high_rebounds VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest number of rebounds on February 6?
| SELECT high_rebounds FROM table_name_53 WHERE date = "february 6" | sql_create_context |
CREATE TABLE table_32576 (
"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.
-- What was the score when essendon was the home te... | SELECT "Home team score" FROM table_32576 WHERE "Home team" = 'essendon' | wikisql |
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 gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '华云韶' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '华云韶' GROUP BY fgwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_90 (
player VARCHAR,
place VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a place of T7 and is from the United States?
| SELECT player FROM table_name_90 WHERE place = "t7" AND country = "united states" | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '21485538' AND t_kc21.MED_SER_ORG_NO = '1900114') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1 | css |
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '8880467' AND wdmzjzjlb.JZKSRQ BETWEEN '2000-03-11' AND '2001-06-23' AND wdmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '8880467' AND bdmzjzjlb.JZKSRQ BETWEEN '2000-03-11' AND '2001-06-23' AND bdmzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE table_name_40 (
total INTEGER,
gold VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest total number of medals for a team ranked smaller than 1 and had 20 gold medals?
| SELECT MAX(total) FROM table_name_40 WHERE gold = 20 AND rank < 1 | sql_create_context |
CREATE TABLE table_10361453_2 (
attendance INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The record of 7-3 had the largest attendance of what?
| SELECT MAX(attendance) FROM table_10361453_2 WHERE record = "7-3" | sql_create_context |
CREATE TABLE table_name_14 (
money___ INTEGER,
country VARCHAR,
to_par VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Money ( $ ), when Country is 'United States', and when To par is '+3'?
| SELECT AVG(money___) AS $__ FROM table_name_14 WHERE country = "united states" AND to_par = "+3" | sql_create_context |
CREATE TABLE table_name_8 (
total INTEGER,
rank VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Rank of 5, and a Silver larger than 0 had what sum of total?
| SELECT SUM(total) FROM table_name_8 WHERE rank = "5" AND silver > 0 | sql_create_context |
CREATE TABLE table_16168 (
"County" text,
"Location" text,
"Street Names" text,
"Milepost" text,
"Roads Intersected" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many mileposts are there on Anne Street?
| SELECT COUNT("Milepost") FROM table_16168 WHERE "Street Names" = 'Anne Street' | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Abnormal coagulation profile" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE table_72017 (
"Wicket" text,
"Runs" text,
"Partnerships" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue did the partnership of herschelle gibbs / justin kemp happen?
| SELECT "Venue" FROM table_72017 WHERE "Partnerships" = 'herschelle gibbs / justin kemp' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id numbe... | SELECT chartevents.charttime 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 = 10855) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WH... | mimic_iii |
CREATE TABLE table_39781 (
"Index" text,
"Name" text,
"Song" text,
"Group Song" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What song had an index of m6?
| SELECT "Song" FROM table_39781 WHERE "Index" = 'm6' | wikisql |
CREATE TABLE table_42376 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2nd leg that has 31-37 as the 1st leg?
| SELECT "2nd leg" FROM table_42376 WHERE "1st leg" = '31-37' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Descr... | SELECT COUNT(*) AS N, TagName FROM PostTags JOIN Tags AS t ON (t.Id = 2032) WHERE PostId IN (SELECT MIN(p.Id) FROM Users AS u JOIN Posts AS p ON (u.Id = OwnerUserId) JOIN PostTypes AS type ON (type.Id = PostTypeId) WHERE type.Name IN ('Question', 'Answer') GROUP BY OwnerUserId) GROUP BY TagName ORDER BY COUNT(*) DESC | sede |
CREATE TABLE table_24171 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the director when the writer(s) was John W. Bloch?
| SELECT "Director" FROM table_24171 WHERE "Writer(s)" = 'John W. Bloch' | 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 WHERE demographic.admission_type = "NEWBORN" AND demographic.admityear < "2157" | mimicsql_data |
CREATE TABLE body_builder (
body_builder_id number,
people_id number,
snatch number,
clean_jerk number,
total number
)
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
birth_date text,
birth_place text
)
-- Using valid SQLite, answer the fol... | SELECT T2.name FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id ORDER BY T1.total DESC | spider |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare 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_... | atis |
CREATE TABLE table_25461946_5 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games were played on november 27?
| SELECT COUNT(record) FROM table_25461946_5 WHERE date = "November 27" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
had... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40435) AND prescriptions.drug = 'insulin human regular' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-03' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_7021 (
"Year" text,
"Team" text,
"SckY" text,
"Int%" text,
"Rate" text,
"RAtt" text,
"RYds" text,
"RAvg" text,
"RLng" text,
"R1st" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the rate for 73 RYds?
| SELECT "Rate" FROM table_7021 WHERE "RYds" = '73' | wikisql |
CREATE TABLE table_57915 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what Da... | SELECT "Date" FROM table_57915 WHERE "Circuit" = 'brands hatch' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.