instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Portal hypertension" | mimicsql_data |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId numb... | SELECT Name, num, UserId AS "user_link" FROM (SELECT Name, num, UserId, ROW_NUMBER() OVER (PARTITION BY Name ORDER BY num DESC) AS rownum FROM (SELECT Name, UserId, COUNT(Id) AS num FROM Badges GROUP BY Name, UserId) AS uc) AS ucn WHERE rownum <= 5 AND num > 2 ORDER BY Name | sede |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT demographic.admission_location, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_name_22 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country is Tiger Woods from?
| SELECT country FROM table_name_22 WHERE player = "tiger woods" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE patients (
row_id number,
subject_id num... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'protein s, functional') AND STRFTIME('%y', labevents.charttime) >= '2100') | mimic_iii |
CREATE TABLE table_name_96 (
developer VARCHAR,
year_of_release VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which developer has a year of cancelled releases?
| SELECT developer FROM table_name_96 WHERE year_of_release = "cancelled" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
... | SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1561)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arter... | mimic_iii |
CREATE TABLE table_70130 (
"Player" text,
"Test Career" text,
"Tests" real,
"Catches" real,
"Stumpings" real,
"Total Dismissals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average dismissals of 83 test and catches less than 33?
| SELECT AVG("Total Dismissals") FROM table_70130 WHERE "Tests" = '83' AND "Catches" < '33' | wikisql |
CREATE TABLE table_44581 (
"Season" text,
"Zone" real,
"Champion" text,
"Second" text,
"Third" text,
"Top scorer" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Third has a Champion of metalurh novomoskovsk?
| SELECT "Third" FROM table_44581 WHERE "Champion" = 'metalurh novomoskovsk' | wikisql |
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4)
)
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(5... | SELECT order_id, SUM(product_quantity) FROM Order_Items GROUP BY order_id | nvbench |
CREATE TABLE table_name_78 (
name VARCHAR,
moving_from VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player was moving from manchester united?
| SELECT name FROM table_name_78 WHERE moving_from = "manchester united" | sql_create_context |
CREATE TABLE table_73561 (
"Seed" real,
"Rank" real,
"Player" text,
"Points" real,
"Points defending" text,
"Points won" real,
"New points" real,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the status for points 3185
| SELECT "Status" FROM table_73561 WHERE "Points" = '3185' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'inject into thorax cavit') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 47460 AND ... | mimic_iii |
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 procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Charles Deshay" | mimicsql_data |
CREATE TABLE table_name_41 (
worldwide VARCHAR,
film VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE WORLDWIDE BOX OFFICE FOR BRAVE?
| SELECT worldwide FROM table_name_41 WHERE film = "brave" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,... | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30307) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 = 2 | mimic_iii |
CREATE TABLE table_14087 (
"Year(s)" real,
"Tournament or series" text,
"Played in" text,
"Games played ( Tests )" text,
"Games won ( Tests )" text,
"Games lost ( Tests )" text,
"Games drawn ( Tests )" text,
"Points for ( Tests )" text,
"Points against ( Tests )" text
)
-- Using va... | SELECT "Games lost ( Tests )" FROM table_14087 WHERE "Games played ( Tests )" = '2' AND "Year(s)" < '1999' AND "Points for ( Tests )" = '24' | wikisql |
CREATE TABLE table_name_52 (
label VARCHAR,
code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Label has a Code of cocy-78365?
| SELECT label FROM table_name_52 WHERE code = "cocy-78365" | sql_create_context |
CREATE TABLE table_73510 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name t... | SELECT "Date" FROM table_73510 WHERE "Score" = 'W 109–95 (OT)' | wikisql |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 mzjzj... | css |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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
... | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7959)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht' ... | mimic_iii |
CREATE TABLE table_name_97 (
athletes VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the athlete from Myanmar?
| SELECT athletes FROM table_name_97 WHERE country = "myanmar" | sql_create_context |
CREATE TABLE table_name_75 (
result VARCHAR,
game_site VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the result for kingdome game site and opponent of denver broncos
| SELECT result FROM table_name_75 WHERE game_site = "kingdome" AND opponent = "denver broncos" | sql_create_context |
CREATE TABLE table_203_528 (
id number,
"year" number,
"political rights" number,
"civil liberties" number,
"status" text,
"president" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many years was it before the first partly free status ?
| SELECT COUNT("year") FROM table_203_528 WHERE id < (SELECT id FROM table_203_528 WHERE "status" = 'partly free') | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "PORT" AND demographic.age < "45" | mimicsql_data |
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 prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2115.0" AND procedures.icd9_code = "4341" | mimicsql_data |
CREATE TABLE table_10826 (
"Date" text,
"Stadium" text,
"Winners" text,
"Runners-up" text,
"Score" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner when the runner-up was Chemnitzer FC II?
| SELECT "Winners" FROM table_10826 WHERE "Runners-up" = 'chemnitzer fc ii' | wikisql |
CREATE TABLE table_56551 (
"Year" text,
"Type" text,
"Nos." text,
"GSWR Class" real,
"GSWR Nos." text,
"GSR Class" text,
"Inchicore Class" text,
"Withdrawn" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Inchicore Class has a GSR Cl... | SELECT "Inchicore Class" FROM table_56551 WHERE "GSR Class" = '235' | wikisql |
CREATE TABLE table_29568 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. Viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the air date for alex taub
| SELECT "Original air date" FROM table_29568 WHERE "Written by" = 'Alex Taub' | wikisql |
CREATE TABLE table_name_37 (
wins INTEGER,
poles VARCHAR,
season VARCHAR,
podiums VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Wins, when Season is 2011, when Podiums is 1, and when Poles is less than 0?
| SELECT MIN(wins) FROM table_name_37 WHERE season = "2011" AND podiums = 1 AND poles < 0 | sql_create_context |
CREATE TABLE table_12146637_1 (
episode_title VARCHAR,
writer_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the episode written by Sheila Lawrence & Henry Alonso Myers?
| SELECT episode_title FROM table_12146637_1 WHERE writer_s_ = "Sheila Lawrence & Henry Alonso Myers" | 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'biopsy' AND STRFTIME('%y', microbiologyevents.charttime) >= '2105') | mimic_iii |
CREATE TABLE table_175980_2 (
viewers__in_millions_ VARCHAR,
ranking VARCHAR,
timeslot VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every value for viewers for ranking #51 for the Tuesday 9:00 p.m. timeslot?
| SELECT viewers__in_millions_ FROM table_175980_2 WHERE ranking = "#51" AND timeslot = "Tuesday 9:00 p.m." | sql_create_context |
CREATE TABLE table_203_731 (
id number,
"pos." text,
"city" text,
"population\n(ab)" number,
"surface\n(km2)" number,
"density\n(ab/km2)" number,
"altitude\n(mslm)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest city in... | SELECT "city" FROM table_203_731 ORDER BY "altitude\n(mslm)" DESC LIMIT 1 | squall |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE days (
days_code varchar,
... | SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'M80' | atis |
CREATE TABLE table_name_43 (
wins INTEGER,
club VARCHAR,
draws VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of wins for the Terang Club, when there are less than 0 draws?
| SELECT AVG(wins) FROM table_name_43 WHERE club = "terang" AND draws < 0 | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABL... | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '10:00' AND course.course_id = course_offering.course_id AND course.department = 'PHYSICS' AND course.number = 522 AND semester.semester = 'WN' A... | advising |
CREATE TABLE table_name_61 (
date VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of Tie no 9?
| SELECT date FROM table_name_61 WHERE tie_no = "9" | sql_create_context |
CREATE TABLE table_20040 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Won" real,
"Drawn" real,
"Lost" real,
"For" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sma... | SELECT MIN("Position") FROM table_20040 WHERE "Difference" = '6' | wikisql |
CREATE TABLE table_29154 (
"Common Name" text,
"Genus & Species" text,
"NCBI Accession Number" text,
"Length (AA)" real,
"% Identity to C7orf38" real,
"% Similarity to C7orf38" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the genus & s... | SELECT "Genus & Species" FROM table_29154 WHERE "NCBI Accession Number" = 'XP_002439156.1' | wikisql |
CREATE TABLE table_64379 (
"Round" real,
"Dates" text,
"Rally Name" text,
"Rally HQ" text,
"Support Category" text,
"Surface" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the Rally HQ for Round 1?
| SELECT "Rally HQ" FROM table_64379 WHERE "Round" = '1' | wikisql |
CREATE TABLE county_public_safety (
county_id number,
name text,
population number,
police_officers number,
residents_per_officer number,
case_burden number,
crime_rate number,
police_force text,
location text
)
CREATE TABLE city (
city_id number,
county_id number,
name ... | SELECT name FROM city ORDER BY white DESC LIMIT 5 | spider |
CREATE TABLE table_53022 (
"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.
-- Who was the away team when Melbourne was the hom... | SELECT "Away team" FROM table_53022 WHERE "Home team" = 'melbourne' | wikisql |
CREATE TABLE table_204_240 (
id number,
"name" text,
"current use" text,
"completed" text,
"namesake" text,
"info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which building is the oldest on the bw campus .
| SELECT "name" FROM table_204_240 ORDER BY "completed" LIMIT 1 | squall |
CREATE TABLE table_15753 (
"Player" text,
"League" real,
"Scottish Cup" real,
"League Cup" real,
"Challenge Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least for Scottish Cup with a Challenge Cup greater than 0,... | SELECT MIN("Scottish Cup") FROM table_15753 WHERE "Challenge Cup" > '0' AND "Player" = 'paul keegan' AND "League Cup" > '0' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9214530' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-05-03' AND '2017-08-22' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2' | css |
CREATE TABLE table_name_59 (
score VARCHAR,
date VARCHAR,
home VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the game on February 26 with the Chicago black hawks as the home team and the New York Rangers as the ... | SELECT score FROM table_name_59 WHERE home = "chicago black hawks" AND visitor = "new york rangers" AND date = "february 26" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_NM = '章俊晤' AND IN_HOSP_DATE BETWEEN '2000-09-18' AND '2013-10-16' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_name_40 (
date VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which date was a game played at Junction Oval?
| SELECT date FROM table_name_40 WHERE venue = "junction oval" | sql_create_context |
CREATE TABLE table_name_26 (
to_par VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the To par for the player whose final score was 67-71=138?
| SELECT to_par FROM table_name_26 WHERE score = 67 - 71 = 138 | sql_create_context |
CREATE TABLE table_23184448_4 (
field_goals INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the field goals for alexis yackley
| SELECT MAX(field_goals) FROM table_23184448_4 WHERE player = "Alexis Yackley" | sql_create_context |
CREATE TABLE table_name_52 (
opponent VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Score of 92 93?
| SELECT opponent FROM table_name_52 WHERE score = "92–93" | sql_create_context |
CREATE TABLE addresses (
address_id number,
line_1 text,
line_2 text,
city text,
zip_postcode text,
state_province_county text,
country text
)
CREATE TABLE candidates (
candidate_id number,
candidate_details text
)
CREATE TABLE student_course_attendance (
student_id number,
... | SELECT student_id FROM student_course_attendance WHERE course_id = 301 | spider |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANC... | atis |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE va... | SELECT CRS_CODE, COUNT(CRS_CODE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE ORDER BY CRS_CODE DESC | nvbench |
CREATE TABLE table_57253 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the leading scorer for 12 january 2008
| SELECT "Leading scorer" FROM table_57253 WHERE "Date" = '12 january 2008' | wikisql |
CREATE TABLE table_204_655 (
id number,
"year" number,
"winner" text,
"album" text,
"other finalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- david dallas won in 2010 . what was the name of the album that won the next year ?
| SELECT "album" FROM table_204_655 WHERE "year" > 2010 ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_name_49 (
finish VARCHAR,
start VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Finish has a Start of 15, and a Team of bahari?
| SELECT finish FROM table_name_49 WHERE start = "15" AND team = "bahari" | sql_create_context |
CREATE TABLE table_54506 (
"Tournament" text,
"Date" text,
"City" text,
"Country" text,
"Surface" text,
"Singles champions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what Date will the Argentina F17 Futures Tournament be played in Argent... | SELECT "Date" FROM table_54506 WHERE "Country" = 'argentina' AND "Tournament" = 'argentina f17 futures' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
dep... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (semester.semester = ... | advising |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid ... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') GROUP BY STRFTIME('%y-%m-%d'... | mimic_iii |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
i... | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-120575' AND patient.hospitaldischargetime IS NULL)) ORDER BY ... | eicu |
CREATE TABLE table_name_96 (
industry INTEGER,
year VARCHAR,
agriculture VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Industry, when Year is greater than 2005, and when Agriculture is greater than 11?
| SELECT MIN(industry) FROM table_name_96 WHERE year > 2005 AND agriculture > 11 | sql_create_context |
CREATE TABLE table_17478 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total numb... | SELECT COUNT("Directed by") FROM table_17478 WHERE "U.S. viewers (millions)" = '11.34' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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_i... | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49654) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', micro... | mimic_iii |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE 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,
... | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '57271172' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2998.53) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '57271172' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLI... | css |
CREATE TABLE table_name_10 (
fin_time VARCHAR,
finish VARCHAR,
track VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the finishing time with a 2/1q finish on the Meadowlands track?
| SELECT fin_time FROM table_name_10 WHERE finish = "2/1q" AND track = "the meadowlands" | sql_create_context |
CREATE TABLE table_26457 (
"Special" text,
"Original airdate" text,
"Iron Chef" text,
"Challenger" text,
"Challenger Specialty" text,
"Theme Ingredient" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner when th... | SELECT "Winner" FROM table_26457 WHERE "Iron Chef" = 'Hiroyuki Sakai' | 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.dob_year < "2182" AND procedures.short_title = "Coronar arteriogr-1 cath" | mimicsql_data |
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperweek number,
gamesplayed number,
onscholarship text
)
CREATE TAB... | SELECT SUM(gamesplayed) FROM sportsinfo | spider |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.short_title = "Nasal sinus dx proc NEC" | mimicsql_data |
CREATE TABLE table_8826 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is City, when IATA is 'amm'?
| SELECT "City" FROM table_8826 WHERE "IATA" = 'amm' | wikisql |
CREATE TABLE table_name_17 (
try_bonus VARCHAR,
tries_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What try bonus has 19 as the tries against?
| SELECT try_bonus FROM table_name_17 WHERE tries_against = "19" | sql_create_context |
CREATE TABLE policies (
policy_id number,
customer_id number,
policy_type_code text,
start_date time,
end_date time
)
CREATE TABLE claims_processing_stages (
claim_stage_id number,
next_claim_stage_id number,
claim_status_name text,
claim_status_description text
)
CREATE TABLE staf... | SELECT customer_details FROM customers ORDER BY customer_details | spider |
CREATE TABLE ship (
TYPE VARCHAR,
flag VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the ship type that are used by both ships with Panama and Malta flags.
| SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta' | sql_create_context |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,... | SELECT DISTINCT name, number FROM course WHERE credits = 12 AND department = 'EECS' | advising |
CREATE TABLE table_36948 (
"Season" text,
"Tropical Lows" real,
"Tropical Cyclones" real,
"Severe Tropical Cyclones" real,
"Strongest storm" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least amount of tropical lows for the 1993 94 sea... | SELECT MIN("Tropical Lows") FROM table_36948 WHERE "Season" = '1993–94' AND "Tropical Cyclones" < '11' | 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 zyjzjlb.ZYZYZDZZBM, zyjzjlb.ZYZYZDZZMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '28470325313' | css |
CREATE TABLE table_78590 (
"Year" text,
"Award" text,
"Category" text,
"Nominated" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the performance nominated for a Capif Award.
| SELECT "Nominated" FROM table_78590 WHERE "Award" = 'capif award' | wikisql |
CREATE TABLE table_name_85 (
loss VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Loss has a Record of 30-32?
| SELECT loss FROM table_name_85 WHERE record = "30-32" | sql_create_context |
CREATE TABLE table_24011 (
"Stations" text,
"Connections" text,
"City/ Neighborhood" text,
"Parking" text,
"Date Opened" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much parking is in Van Nuys at the Sepulveda station?
| SELECT "Parking" FROM table_24011 WHERE "City/ Neighborhood" = 'Van Nuys' AND "Stations" = 'Sepulveda' | wikisql |
CREATE TABLE race (
race_id number,
name text,
class text,
date text,
track_id text
)
CREATE TABLE track (
track_id number,
name text,
location text,
seating number,
year_opened number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- S... | SELECT T1.name, T1.date, T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id | spider |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 48 AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-1 year')) | mimic_iii |
CREATE TABLE table_203_426 (
id number,
"year" number,
"title" text,
"peak chart positions\naus" number,
"peak chart positions\nnz" number,
"peak chart positions\nuk" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what 's the... | SELECT "title" FROM table_203_426 WHERE "year" > (SELECT "year" FROM table_203_426 WHERE "title" = '"wide open road"') ORDER BY "year" LIMIT 1 | squall |
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 Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE table_204_115 (
id number,
"year" number,
"track" text,
"number" number,
"team" text,
"car" text,
"round result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many 1st place round results were there ?
| SELECT COUNT(*) FROM table_204_115 WHERE "round result" = 1 | squall |
CREATE TABLE table_22815259_1 (
game INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most game for record 4-0
| SELECT MAX(game) FROM table_22815259_1 WHERE record = "4-0" | sql_create_context |
CREATE TABLE table_name_13 (
points INTEGER,
goals_against VARCHAR,
coach VARCHAR,
tied VARCHAR,
games VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the points average when the tied is greater than 8, less than 82 games and the coach of ... | SELECT AVG(points) FROM table_name_13 WHERE tied > 8 AND games < 82 AND coach = "bryan mclay † morris lallo ‡ gerry moore ‡" AND goals_against > 322 | sql_create_context |
CREATE TABLE table_77063 (
"Team" text,
"Location" text,
"Venue" text,
"Capacity" real,
"Position in 2005" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Venue that has the Position in 2005 of 8?
| SELECT "Venue" FROM table_77063 WHERE "Position in 2005" = '8' | wikisql |
CREATE TABLE table_42885 (
"Table 2: Depression Data" text,
"1929" real,
"1931" real,
"1933" real,
"1937" real,
"1938" real,
"1940" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest 1937 value that has a 1940 value over 126?... | SELECT MAX("1937") FROM table_42885 WHERE "1940" > '126' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | SELECT EMAIL, EMPLOYEE_ID FROM employees ORDER BY EMAIL DESC | nvbench |
CREATE TABLE table_42675 (
"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 was the aggregate for the match with a team 2 of Kenya?
| SELECT "Agg." FROM table_42675 WHERE "Team 2" = 'kenya' | wikisql |
CREATE TABLE table_name_34 (
moving_to VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did Konchesky move to?
| SELECT moving_to FROM table_name_34 WHERE name = "konchesky" | sql_create_context |
CREATE TABLE table_28884858_1 (
capacity_percentage VARCHAR,
total_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the capacity percentage when the total attendance is 509940?
| SELECT capacity_percentage FROM table_28884858_1 WHERE total_attendance = 509940 | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT SHRGH, SHRXM FROM jybgb WHERE JZLSH = '71249027132' GROUP BY SHRGH HAVING COUNT(*) > 13 | css |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,... | SELECT COUNT(*) AS "count" FROM Badges AS b WHERE (b.Name IN ('Caucus', 'Constituent')) GROUP BY b.Name LIMIT 100 | sede |
CREATE TABLE table_name_93 (
division VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What divisions was in the year 1993?
| SELECT division FROM table_name_93 WHERE year = 1993 | sql_create_context |
CREATE TABLE Staff (
staff_id INTEGER,
gender VARCHAR(1),
first_name VARCHAR(80),
last_name VARCHAR(80),
email_address VARCHAR(255),
phone_number VARCHAR(80)
)
CREATE TABLE Complaints (
complaint_id INTEGER,
product_id INTEGER,
customer_id INTEGER,
complaint_outcome_code VARCHAR... | SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY AVG(product_price) 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 T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder | nvbench |
CREATE TABLE table_10975 (
"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.
-- At the match which took place in arden street ov... | SELECT "Away team score" FROM table_10975 WHERE "Venue" = 'arden street oval' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.