instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_65 (
founded VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the year Airds High School was founded?
| SELECT founded FROM table_name_65 WHERE school = "airds high school" | sql_create_context |
CREATE TABLE table_name_99 (
lead VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Lead has a Nation of croatia?
| SELECT lead FROM table_name_99 WHERE nation = "croatia" | sql_create_context |
CREATE TABLE table_35841 (
"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 has a Nation of spain?
| SELECT MAX("Bronze") FROM table_35841 WHERE "Nation" = 'spain' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate ti... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cardiac arrest') A... | mimic_iii |
CREATE TABLE table_30332 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed 'it's a wonde... | SELECT "Directed by" FROM table_30332 WHERE "Title" = 'It''s a Wonderful Lie' | wikisql |
CREATE TABLE table_55682 (
"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 is the date of the game at Geelong?
| SELECT "Date" FROM table_55682 WHERE "Away team" = 'geelong' | wikisql |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
... | SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '68417064' AND mzjzjlb.JZKSRQ BETWEEN '2009-12-28' AND '2021-09-30' AND mzjzjlb.YLJGDM = '1278762' | css |
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults number,
kids number
)
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
basepric... | SELECT bedtype, AVG(baseprice) FROM rooms GROUP BY bedtype | spider |
CREATE TABLE table_17355628_7 (
score VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games were played by team @ New Jersey?
| SELECT COUNT(score) FROM table_17355628_7 WHERE team = "@ New Jersey" | 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 medication (
medi... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '003-48563' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '003-48563' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
... | SELECT * FROM PostTypes | sede |
CREATE TABLE table_15189 (
"Year" real,
"Population (Total)" real,
"(Barcaldine)" real,
"(Aramac)" real,
"(Jericho)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average (Barcaldine) with a Population (Total) less than 3,594 and a 920 ... | SELECT AVG("(Barcaldine)") FROM table_15189 WHERE "Population (Total)" < '3,594' AND "(Jericho)" = '920' AND "Year" > '2006' | wikisql |
CREATE TABLE table_55842 (
"Year" real,
"MRHMA" text,
"USCA" text,
"RTHK" text,
"Joint Music Award" text,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Joint Music Awards were there with a RTHK of 1, in a Year before 2006?
| SELECT "Joint Music Award" FROM table_55842 WHERE "Year" < '2006' AND "RTHK" = '1' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25705')) AND lab.labname = '-eos' AND DATETIME(lab.labresulttime, 'start of mon... | eicu |
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE partic... | SELECT fname, lname FROM faculty WHERE rank = "Instructor" | spider |
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 prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Simethicone" | mimicsql_data |
CREATE TABLE table_name_97 (
total INTEGER,
silver VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average total number of medals for a nation with 2 silver medals and a rank larger than 7?
| SELECT AVG(total) FROM table_name_97 WHERE silver = 2 AND rank > 7 | sql_create_context |
CREATE TABLE table_11677691_6 (
hometown VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is Norco HIgh School?
| SELECT hometown FROM table_11677691_6 WHERE school = "Norco High school" | sql_create_context |
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state varchar(20)
)
CREATE TABLE loan (
loan_ID varchar(3),
loan_type varchar(15),
cust_ID varchar(3),
branch_ID varchar(3)... | SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY acc_bal DESC | nvbench |
CREATE TABLE table_name_10 (
nation VARCHAR,
silver VARCHAR,
total VARCHAR,
gold VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which nation has 0 gold, a rank greater than 14, a total of 1, and silver less than 1?
| SELECT nation FROM table_name_10 WHERE gold = 0 AND rank > 14 AND total = 1 AND silver < 1 | sql_create_context |
CREATE TABLE table_name_45 (
score VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the two-round score for Bob Tway?
| SELECT score FROM table_name_45 WHERE player = "bob tway" | sql_create_context |
CREATE TABLE gyb (
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 * FROM qtb WHERE qtb.PERSON_NM = '方语诗' AND qtb.MED_SER_ORG_NO = '8013694' AND qtb.MED_ORG_DEPT_NM LIKE '%全科%' UNION SELECT * FROM gyb WHERE gyb.PERSON_NM = '方语诗' AND gyb.MED_SER_ORG_NO = '8013694' AND gyb.MED_ORG_DEPT_NM LIKE '%全科%' UNION SELECT * FROM zyb WHERE zyb.PERSON_NM = '方语诗' AND zyb.MED_SER_ORG_NO = '80... | css |
CREATE TABLE table_65365 (
"1953" text,
"1954" text,
"1955" text,
"1956" text,
"1957" text,
"1958" text,
"1959" text,
"1960" text,
"1961" text,
"1962" text,
"1963" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is 1955 w... | SELECT "1955" FROM table_65365 WHERE "1961" = 'n/a' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "58" AND procedures.long_title = "Hemodialysis" | mimicsql_data |
CREATE TABLE table_name_72 (
event VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Event, when Date is August 20-August 27?
| SELECT event FROM table_name_72 WHERE date = "august 20-august 27" | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE table_name_42 (
top_25 INTEGER,
events INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the low number of top 25s in an event with over 15 appearances?
| SELECT MIN(top_25) FROM table_name_42 WHERE events > 15 | sql_create_context |
CREATE TABLE table_name_49 (
position VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the position of the player who was picked in round 22?
| SELECT position FROM table_name_49 WHERE round = 22 | sql_create_context |
CREATE TABLE table_4900 (
"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 a home team score 9.9 (63)?
| SELECT "Date" FROM table_4900 WHERE "Home team score" = '9.9 (63)' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'entral infu... | mimic_iii |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2129" AND diagnoses.icd9_code = "5718" | mimicsql_data |
CREATE TABLE table_28653 (
"Year (Ceremony)" text,
"Film title" text,
"Main Language(s)" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the year (ceremony) 1998 (71st), what are all the main languages?
| SELECT "Main Language(s)" FROM table_28653 WHERE "Year (Ceremony)" = '1998 (71st)' | 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 WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.admityear < "2127" | mimicsql_data |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | SELECT JOB_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID | nvbench |
CREATE TABLE editor (
editor_id number,
name text,
age number
)
CREATE TABLE journal (
journal_id number,
date text,
theme text,
sales number
)
CREATE TABLE journal_committee (
editor_id number,
journal_id number,
work_type text
)
-- Using valid SQLite, answer the following q... | SELECT name FROM editor ORDER BY age LIMIT 1 | spider |
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 SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7165) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND inputevents_c... | mimic_iii |
CREATE TABLE table_23392 (
"No. in series" text,
"No. in season" real,
"Family/families" text,
"Location(s)" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the episode with the Ririe family air for the first time?
| SELECT "Original air date" FROM table_23392 WHERE "Family/families" = 'The Ririe Family' | wikisql |
CREATE TABLE table_10577579_2 (
mens_nickname VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Mens Nickname for the member location of Jacksonville, florida?
| SELECT mens_nickname FROM table_10577579_2 WHERE location = "Jacksonville, Florida" | sql_create_context |
CREATE TABLE table_57042 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue resulted in 2nd before 2005?
| SELECT "Venue" FROM table_57042 WHERE "Result" = '2nd' AND "Year" < '2005' | wikisql |
CREATE TABLE table_name_31 (
actor VARCHAR,
soap_opera VARCHAR,
years VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the actor for shortland street for the years 1993 1999, 2001 2003, 2007, 2009 ?
| SELECT actor FROM table_name_31 WHERE soap_opera = "shortland street" AND years = "1993–1999, 2001–2003, 2007, 2009—" | sql_create_context |
CREATE TABLE table_18600760_19 (
land___sqmi__ VARCHAR,
longitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many lands with longitude of -100.895783 are?
| SELECT COUNT(land___sqmi__) FROM table_18600760_19 WHERE longitude = "-100.895783" | sql_create_context |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For d... | SELECT year, COUNT(year) FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title | nvbench |
CREATE TABLE table_53528 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT COUNT("Played") FROM table_53528 WHERE "Goal Difference" > '0' AND "Club" = 'valencia cf' | wikisql |
CREATE TABLE table_name_33 (
top_5 INTEGER,
top_25 VARCHAR,
cuts_made VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Top-5, when Top-25 is less than 4, and when Cuts made is less than 7?
| SELECT MIN(top_5) FROM table_name_33 WHERE top_25 < 4 AND cuts_made < 7 | sql_create_context |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transaction_id INTEGER,
account_id INTEGER,
card_id INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DOUBLE,
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(... | SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type DESC | nvbench |
CREATE TABLE table_203_830 (
id number,
"year" number,
"song" text,
"chart positions\nus country" number,
"chart positions\ncan country" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which song of his reached number 1 in the us ... | SELECT "song" FROM table_203_830 WHERE "chart positions\nus country" = 1 | squall |
CREATE TABLE table_39096 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of overall figures when duke was the college and the round wa... | SELECT SUM("Overall") FROM table_39096 WHERE "College" = 'duke' AND "Round" > '7' | wikisql |
CREATE TABLE table_name_90 (
date VARCHAR,
catalogue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has a catalogue of asw 40362?
| SELECT date FROM table_name_90 WHERE catalogue = "asw 40362" | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou... | advising |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_9608 (
"Missouri vs." text,
"Overall Record" text,
"at Columbia" text,
"at Opponent's Venue" text,
"at Neutral Site" text,
"Last 5 Meetings" text,
"Last 10 Meetings" text,
"Current Streak" text,
"During Time in Big 12" text
)
-- Using valid SQLite, answer the fol... | SELECT "Current Streak" FROM table_9608 WHERE "Last 10 Meetings" = 'ku, 8-2' | wikisql |
CREATE TABLE table_79073 (
"Number" real,
"Year Start" real,
"Year End" real,
"Name" text,
"Home Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Number has a Home Club of broomstones, and a Year End smaller than 1999?
| SELECT MIN("Number") FROM table_79073 WHERE "Home Club" = 'broomstones' AND "Year End" < '1999' | wikisql |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.c... | atis |
CREATE TABLE table_26150013_1 (
title VARCHAR,
original_air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many titles are there for the original air date April 3, 2012?
| SELECT COUNT(title) FROM table_26150013_1 WHERE original_air_date = "April 3, 2012" | sql_create_context |
CREATE TABLE table_53847 (
"Species" text,
"Strain" text,
"Type" text,
"Base Pairs" real,
"Genes" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowst base pair with a Species of borrelia garinii, and a Genes larger than 832?
| SELECT MIN("Base Pairs") FROM table_53847 WHERE "Species" = 'borrelia garinii' AND "Genes" > '832' | wikisql |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program (
program_id int,
name varchar... | SELECT DISTINCT has_projects FROM course WHERE department = 'EECS' AND number = 473 | advising |
CREATE TABLE table_name_36 (
no_range VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the number range for 4vip
| SELECT no_range FROM table_name_36 WHERE type = "4vip" | sql_create_context |
CREATE TABLE table_70725 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is the record 5-4?
| SELECT "Date" FROM table_70725 WHERE "Record" = '5-4' | wikisql |
CREATE TABLE table_name_39 (
winner VARCHAR,
finalist VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner of the season before 2010 with Lietuvos Rytas as a finalist?
| SELECT winner FROM table_name_39 WHERE finalist = "lietuvos rytas" AND season < 2010 | sql_create_context |
CREATE TABLE table_name_73 (
competition_or_tour VARCHAR,
ground VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which competition or tour was nordsj lland the opponent with a hr Ground?
| SELECT competition_or_tour FROM table_name_73 WHERE ground = "hr" AND opponent = "nordsjælland" | sql_create_context |
CREATE TABLE table_75222 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what team has a score of 2
| SELECT "Score" FROM table_75222 WHERE "Points" = '2' | 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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name te... | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24330) AND prescriptions.drug = 'fludrocortisone acetate' | mimic_iii |
CREATE TABLE table_name_36 (
v_mph_ INTEGER,
saffir_simpson_category VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the lowest V(mph) for a Saffir-Simpson of 4 in 2005?
| SELECT MIN(v_mph_) FROM table_name_36 WHERE saffir_simpson_category = 4 AND year = 2005 | sql_create_context |
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Students (
stud... | SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id... | SELECT p.Id, p.Score, u.DisplayName, u.Reputation FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL AND p.CreationDate > '2014-01-18' | sede |
CREATE TABLE bdmzjzjlb (
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(wdmzjzjlb.ZZYSGH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '34563100' AND wdmzjzjlb.JZKSRQ BETWEEN '2007-12-12' AND '2020-01-21' UNION SELECT COUNT(bdmzjzjlb.ZZYSGH) FROM hz_info JOIN bdmzjzjlb ON hz_... | css |
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABLE faculty_partic... | SELECT fname, lname, phone FROM faculty WHERE sex = 'F' | spider |
CREATE TABLE table_65958 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT MIN("Land ( sqmi )") FROM table_65958 WHERE "Water (sqmi)" < '0.04' AND "Longitude" = '-96.794706' | 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 * FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i... | css |
CREATE TABLE table_12279 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Tournament has a Opponent of piero luisi?
| SELECT "Tournament" FROM table_12279 WHERE "Opponent" = 'piero luisi' | wikisql |
CREATE TABLE table_23538 (
"District" text,
"Representative" text,
"Party Change?" text,
"Prior background" text,
"Religion" text,
"Birth year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a religion of United Methodist and a prior bac... | SELECT "Representative" FROM table_23538 WHERE "Religion" = 'United Methodist' AND "Prior background" = 'Congressional aide' | wikisql |
CREATE TABLE table_name_15 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Record on the Date May 8?
| SELECT record FROM table_name_15 WHERE date = "may 8" | sql_create_context |
CREATE TABLE catalog_contents_additional_attributes (
catalog_entry_id number,
catalog_level_number number,
attribute_id number,
attribute_value text
)
CREATE TABLE attribute_definitions (
attribute_id number,
attribute_name text,
attribute_data_type text
)
CREATE TABLE catalog_contents (
... | SELECT COUNT(*) FROM catalog_contents | spider |
CREATE TABLE table_name_57 (
goals INTEGER,
games VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Goals have Games smaller than 41, and a Player of mark amos?
| SELECT MIN(goals) FROM table_name_57 WHERE games < 41 AND player = "mark amos" | sql_create_context |
CREATE TABLE table_76104 (
"Features" text,
"Foundation" text,
"Standard" text,
"Enterprise" text,
"Datacenter" text,
"Itanium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Foundation has an Enterprise of 2?
| SELECT "Foundation" FROM table_76104 WHERE "Enterprise" = '2' | wikisql |
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | SELECT Date, SUM(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date | nvbench |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalp... | 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 = '002-17348')) AND lab.labname = 'pt' | eicu |
CREATE TABLE table_73522 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who ha... | SELECT "High points" FROM table_73522 WHERE "Location Attendance" = 'Toyota Center 15,095' | 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.JYZBLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb... | css |
CREATE TABLE zzmzjzjlb (
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 (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '2003934' AND jybgb.BGRQ BETWEEN '2012-08-24' AND '2015-07-31' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 12 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb... | css |
CREATE TABLE table_11168 (
"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 day did South Melbourne play as the away te... | SELECT "Date" FROM table_11168 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE table_69874 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team lost on May 1?
| SELECT "Loss" FROM table_69874 WHERE "Date" = 'may 1' | wikisql |
CREATE TABLE table_57460 (
"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 did the home team score when the away team ... | SELECT "Home team score" FROM table_57460 WHERE "Away team score" = '12.12 (84)' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.itemid = "50822" | mimicsql_data |
CREATE TABLE table_204_26 (
id number,
"name" text,
"position" text,
"birth date/age at start of campaign" text,
"games in campaign" text,
"club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the next player listed after andy egil ?
| SELECT "name" FROM table_204_26 WHERE id = (SELECT id FROM table_204_26 WHERE "name" = 'andy egli') + 1 | squall |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Regular_Season | nvbench |
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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '邹高峻' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 3531.29) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '邹高峻' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT... | css |
CREATE TABLE table_train_11 (
"id" int,
"pregnancy_or_lactation" bool,
"severe_sepsis" bool,
"active_infection" bool,
"heart_disease" bool,
"body_weight" float,
"septic_shock" bool,
"serum_aminotransferase_level_alt_ast" int,
"NOUSE" float
)
-- Using valid SQLite, answer the follow... | SELECT * FROM table_train_11 WHERE heart_disease = 1 OR heart_disease = 1 | criteria2sql |
CREATE TABLE table_204_724 (
id number,
"outcome" text,
"no." number,
"date" text,
"tournament" text,
"surface" text,
"partner" text,
"opponents in the final" text,
"score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT COUNT(*) FROM table_204_724 WHERE "surface" = 'hard' | squall |
CREATE TABLE election (
Election_ID int,
Representative_ID int,
Date text,
Votes real,
Vote_Percent real,
Seats real,
Place real
)
CREATE TABLE representative (
Representative_ID int,
Name text,
State text,
Party text,
Lifespan text
)
-- Using valid SQLite, answer the ... | SELECT Party, COUNT(Party) FROM representative GROUP BY Party | nvbench |
CREATE TABLE table_24650 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT "Year" FROM table_24650 WHERE "Winnings" = '$281,945' | wikisql |
CREATE TABLE table_name_55 (
team VARCHAR,
position_in_table VARCHAR,
outgoing_manager VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Team that has a Position in table of 15th (a) and a Outgoing manager of claudio borghi?
| SELECT team FROM table_name_55 WHERE position_in_table = "15th (a)" AND outgoing_manager = "claudio borghi" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(2... | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID | nvbench |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) AND DATETIME(labevents.chartti... | mimic_iii |
CREATE TABLE Participants_in_Events (
event_id VARCHAR
)
CREATE TABLE EVENTS (
event_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many events did not have any participants?
| SELECT COUNT(*) FROM EVENTS WHERE NOT event_id IN (SELECT event_id FROM Participants_in_Events) | sql_create_context |
CREATE TABLE table_name_49 (
second_vice_president VARCHAR,
inaugurated VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Second Vice President, when Inaugurated is '15 March 1935'?
| SELECT second_vice_president FROM table_name_49 WHERE inaugurated = "15 march 1935" | sql_create_context |
CREATE TABLE table_27914606_1 (
season__number VARCHAR,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of the episode in the season that had 7.19 millions of north american viewers?
| SELECT season__number FROM table_27914606_1 WHERE us_viewers__millions_ = "7.19" | sql_create_context |
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
-- Using valid SQLite, answer the following questions ... | SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T2.Height DESC | nvbench |
CREATE TABLE table_60166 (
"Model" text,
"Screen size" text,
"Bluetooth" text,
"FM transmitter" text,
"Flash" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the screen size of the s45 (Australia only) Model with no bluetooth?
| SELECT "Screen size" FROM table_60166 WHERE "Bluetooth" = 'no' AND "Model" = 's45 (australia only)' | 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 WHERE demographic.admission_type = "ELECTIVE" AND demographic.ethnicity = "ASIAN" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.