instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TA... | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 597 OR course.number = 521) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... | advising |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTy... | SELECT Reputation FROM Users WHERE Id = '##userId##' | sede |
CREATE TABLE table_15909409_2 (
total_freshwater_withdrawal__km_3__yr_ VARCHAR,
agricultural_use__m_3__p_yr__in__percentage_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In Pakistan, what was the total freshwater withdrawal (km 3 /yr) where the agricultura... | SELECT total_freshwater_withdrawal__km_3__yr_ FROM table_15909409_2 WHERE agricultural_use__m_3__p_yr__in__percentage_ = "1029(96%)" | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.drug = "Thiamine" | mimicsql_data |
CREATE TABLE table_15315816_1 (
dates VARCHAR,
score VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When are all dates with a score of 205 ( 8) in Australia?
| SELECT dates FROM table_15315816_1 WHERE score = "205 (–8)" AND country = "Australia" | sql_create_context |
CREATE TABLE table_52502 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the show with the production code k2708?
| SELECT "Directed by" FROM table_52502 WHERE "Production code" = 'k2708' | wikisql |
CREATE TABLE table_67223 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the score 1 0, and the result 4 0?
| SELECT "Date" FROM table_67223 WHERE "Score" = '1–0' AND "Result" = '4–0' | wikisql |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '邹浩慨' AND mzjzjlb.JZKSRQ BETWEEN '2001-06-20' AND '2018-02-12' AND mzjzjlb.YLJGDM = '6233907' | css |
CREATE TABLE table_77186 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest number of attendance in a week before 8 and game on October 25, 1981?
| SELECT MAX("Attendance") FROM table_77186 WHERE "Date" = 'october 25, 1981' AND "Week" < '8' | wikisql |
CREATE TABLE table_27857 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" text,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the lar... | SELECT "Largest ethnic group (2002)" FROM table_27857 WHERE "Settlement" = 'Gunaroš' | wikisql |
CREATE TABLE table_name_46 (
overall_record VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Overall Record that has the Away Team of miami?
| SELECT overall_record FROM table_name_46 WHERE away_team = "miami" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '姜淑华' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 2959.88) | css |
CREATE TABLE table_name_77 (
event VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Event has a Competition of world championships?
| SELECT event FROM table_name_77 WHERE competition = "world championships" | sql_create_context |
CREATE TABLE table_53787 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total round with an overall of 199 with sweden?
| SELECT SUM("Round") FROM table_53787 WHERE "Nationality" = 'sweden' AND "Overall" = '199' | wikisql |
CREATE TABLE table_name_25 (
attendance INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Attendance, when Date is 'Oct. 26'?
| SELECT MAX(attendance) FROM table_name_25 WHERE date = "oct. 26" | sql_create_context |
CREATE TABLE table_1425958_1 (
_percentage_change VARCHAR,
population_rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the population rank is 34, what the is % change?
| SELECT _percentage_change FROM table_1425958_1 WHERE population_rank = 34 | sql_create_context |
CREATE TABLE table_19469 (
"Team" text,
"# appearances" real,
"years (won in bold)" text,
"# wins" real,
"# runner-up" real,
"Most recent final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of runner-up results for the years... | SELECT MAX("# runner-up") FROM table_19469 WHERE "years (won in bold)" = '1984, 2010' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | SELECT inputevents_cv.charttime 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 = 31696)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label... | mimic_iii |
CREATE TABLE table_name_13 (
pick__number VARCHAR,
nhl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Pick # does the St. Louis Blues have?
| SELECT pick__number FROM table_name_13 WHERE nhl_team = "st. louis blues" | sql_create_context |
CREATE TABLE player_coach (
Player_ID int,
Coach_ID int,
Starting_year int
)
CREATE TABLE player (
Player_ID int,
Sponsor_name text,
Player_name text,
Gender text,
Residence text,
Occupation text,
Votes int,
Rank text
)
CREATE TABLE match_result (
Rank int,
Club_ID ... | SELECT Occupation, COUNT(Occupation) FROM player GROUP BY Occupation ORDER BY COUNT(Occupation) | nvbench |
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 MIN(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" | mimicsql_data |
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min numeric(2)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE instructor (
... | SELECT year, COUNT(*) FROM section GROUP BY semester ORDER BY year DESC | nvbench |
CREATE TABLE table_18183850_12 (
score VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when the opponent was Dominika Cibulkov ?
| SELECT score FROM table_18183850_12 WHERE opponent = "Dominika Cibulková" | sql_create_context |
CREATE TABLE table_13641 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the points c... | SELECT "Points classification" FROM table_13641 WHERE "General classification" = 'denis menchov' AND "Stage" = '18' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ck-mb index') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13054) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-81 month') | mimic_iii |
CREATE TABLE table_27210 (
"Player" text,
"Minutes" real,
"Field Goals" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player has 17 blocks?
| SELECT "Player" FROM table_27210 WHERE "Blocks" = '17' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_tags_count (
co... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%hardw... | advising |
CREATE TABLE table_28059992_1 (
position VARCHAR,
cfl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every position for the CFL Edmonton?
| SELECT position FROM table_28059992_1 WHERE cfl_team = "Edmonton" | sql_create_context |
CREATE TABLE table_1011906_1 (
land_area VARCHAR,
seat_of_rcm VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the land area with seat of rcm being granby
| SELECT land_area FROM table_1011906_1 WHERE seat_of_rcm = "Granby" | sql_create_context |
CREATE TABLE table_32842 (
"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 away team that played at Princes Pa... | SELECT "Away team" FROM table_32842 WHERE "Venue" = 'princes park' | wikisql |
CREATE TABLE t_kc21 (
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0440426' AND t_kc21.IN_DIAG_DIS_NM = '精神障碍') | css |
CREATE TABLE table_27922491_20 (
economy VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many 4wi were recorded by the player with an economy of 4.17?
| SELECT 4 AS wi FROM table_27922491_20 WHERE economy = "4.17" | sql_create_context |
CREATE TABLE table_37605 (
"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 Date has an Outcome of winner, and a Score of 7 5, 6 4?
| SELECT "Date" FROM table_37605 WHERE "Outcome" = 'winner' AND "Score" = '7–5, 6–4' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" | mimicsql_data |
CREATE TABLE table_name_35 (
against INTEGER,
wins VARCHAR,
geelong_fl VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Against has more than 11 wins, and a Geelong FL of st josephs?
| SELECT MIN(against) FROM table_name_35 WHERE wins > 11 AND geelong_fl = "st josephs" | sql_create_context |
CREATE TABLE table_35623 (
"Triple" real,
"Game" real,
"Date" text,
"Inning" text,
"Location" text,
"Opposing Pitcher" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Opposing Pitcher when Team is phillies, Location is... | SELECT "Opposing Pitcher" FROM table_35623 WHERE "Team" = 'phillies' AND "Location" = 'pittsburgh' AND "Inning" = '8th' | wikisql |
CREATE TABLE table_27876486_2 (
clubs VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the club in the sixth round proper
| SELECT clubs FROM table_27876486_2 WHERE round = "Sixth round proper" | sql_create_context |
CREATE TABLE table_name_22 (
status VARCHAR,
area_km_2 VARCHAR,
census_ranking VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What status has an area km 2 greater than 10.9, with 4,674 of 5,008 as the census ranking
| SELECT status FROM table_name_22 WHERE area_km_2 > 10.9 AND census_ranking = "4,674 of 5,008" | sql_create_context |
CREATE TABLE table_60031 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Tie No is '109'?
| SELECT "Score" FROM table_60031 WHERE "Tie no" = '109' | wikisql |
CREATE TABLE table_name_62 (
nation VARCHAR,
bronze VARCHAR,
total VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Nation when there is a total less than 27, gold is less than 1, and bronze is more than 1?
| SELECT nation FROM table_name_62 WHERE total < 27 AND gold < 1 AND bronze > 1 | sql_create_context |
CREATE TABLE table_11964047_9 (
home VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the home where date is march 27
| SELECT home FROM table_11964047_9 WHERE date = "March 27" | sql_create_context |
CREATE TABLE table_name_80 (
record VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Milcah Chemos' record?
| SELECT record FROM table_name_80 WHERE athlete = "milcah chemos" | sql_create_context |
CREATE TABLE table_67484 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" text,
"Roll" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With what Name does the Roll of 637 belong?
| SELECT "Name" FROM table_67484 WHERE "Roll" = '637' | wikisql |
CREATE TABLE table_name_18 (
score VARCHAR,
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score at Spartan Stadium when San Jose was the Home team?
| SELECT score FROM table_name_18 WHERE home_team = "san jose" AND venue = "spartan stadium" | sql_create_context |
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE > 7) | css |
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE flight (
flno number(4,0),
origin var... | SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid | nvbench |
CREATE TABLE table_60245 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To Par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country was the golfer with a score of 72-72-72=216 representing?
| SELECT "Country" FROM table_60245 WHERE "Score" = '72-72-72=216' | wikisql |
CREATE TABLE table_38582 (
"Designation HD" text,
"Constellation" text,
"Date sent" text,
"Arrival date" text,
"Message" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date sent has orion as the constellation?
| SELECT "Date sent" FROM table_38582 WHERE "Constellation" = 'orion' | wikisql |
CREATE TABLE table_1939235_1 (
league VARCHAR,
regular_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 4th, great lakes is the regular season what is the league?
| SELECT league FROM table_1939235_1 WHERE regular_season = "4th, Great Lakes" | sql_create_context |
CREATE TABLE table_14110 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Week has a TV Time of cbs 1:00pm, and an Attendance of 72,714?
| SELECT "Week" FROM table_14110 WHERE "TV Time" = 'cbs 1:00pm' AND "Attendance" = '72,714' | wikisql |
CREATE TABLE table_name_74 (
goals INTEGER,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For Getafe CF, what is the highest number of goals scored?
| SELECT MAX(goals) FROM table_name_74 WHERE team = "getafe cf" | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_id", (CASE WHEN DisplayName LIKE '%arbar%zha%' THEN '|_' + DisplayName + '_|' ELSE DisplayName END) AS DisplayName, Reputation, Location FROM Users WHERE (LOWER(Location) LIKE '%turke%' OR LOWER(Location) LIKE '%t rki%' OR LOWER(Location) LIKE '%tu... | sede |
CREATE TABLE table_name_84 (
kanji VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Kanji for the Ayanami dd-45?
| SELECT kanji FROM table_name_84 WHERE name = "ayanami dd-45" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT demographic.days_stay, demographic.discharge_location FROM demographic WHERE demographic.name = "Elizabeth Bateman" | mimicsql_data |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31325)) AND DATETIME(outputevents.charttim... | mimic_iii |
CREATE TABLE table_name_79 (
title VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title in 1991?
| SELECT title FROM table_name_79 WHERE year = "1991" | sql_create_context |
CREATE TABLE table_66920 (
"!accented mora" text,
"one mora" text,
"two-mora word" text,
"three-mora word" text,
"gloss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the three-mora word with a low tone accented mora and a one mora of 2?
| SELECT "three-mora word" FROM table_66920 WHERE "!accented mora" = 'low tone' AND "one mora" = '2' | wikisql |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.departure_time > 1400 AND flight.to_airport = AIRPORT_SERVICE_1.airpor... | atis |
CREATE TABLE table_33703 (
"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 is south melbourne the away side?
| SELECT "Date" FROM table_33703 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE table_56828 (
"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.
-- If fitzroy is the Away team, what Date did they ... | SELECT "Date" FROM table_56828 WHERE "Away team" = 'fitzroy' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-10407')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... | eicu |
CREATE TABLE table_train_278 (
"id" int,
"gender" string,
"supine" bool,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"estimated_glomerular_filtration_rate_egfr" int,
"diastolic_blood_pressure_dbp" int,
"serum_creatinine" float,
"bilirubin" float,
"NOUSE" floa... | SELECT * FROM table_train_278 WHERE bilirubin >= 2 | criteria2sql |
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 prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12726) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE... | mimic_iii |
CREATE TABLE table_12784134_1 (
meaning VARCHAR,
basic_stem__root_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What does the basic stem (root) -rama- mean?
| SELECT meaning FROM table_12784134_1 WHERE basic_stem__root_ = "-rama-" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT p.Id AS "post_link", tc.c AS TagCount FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id LEFT JOIN (SELECT COUNT(*) AS c, PostId FROM PostTags GROUP BY PostId) AS tc ON p.Id = tc.PostId WHERE p.AcceptedAnswerId IS NULL AND p.CommunityOwnedDate IS NULL AND p.ClosedDate IS NU... | sede |
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 demographic.admission_location FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM A... | css |
CREATE TABLE table_name_35 (
year VARCHAR,
playoffs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of years for quarterfinals
| SELECT COUNT(year) FROM table_name_35 WHERE playoffs = "quarterfinals" | sql_create_context |
CREATE TABLE table_37818 (
"2005/ 06" text,
"2006/ 07" text,
"2007/ 08" text,
"2008/ 09" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2007/ 08 has a 2010/ 11 of ... | SELECT "2007/ 08" FROM table_37818 WHERE "2010/ 11" = 'not held' AND "2011/ 12" = 'not held' AND "2008/ 09" = 'not held' AND "2006/ 07" = 'lq' | wikisql |
CREATE TABLE table_32072 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the value for 2010 when the 2012 value is Q2?
| SELECT "2010" FROM table_32072 WHERE "2012" = 'q2' | wikisql |
CREATE TABLE table_63344 (
"Title" text,
"Series" text,
"Director" text,
"Production Number" text,
"Release date" text,
"reissue?" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Series with a Title of elmer's pet rabbit?
| SELECT "Series" FROM table_63344 WHERE "Title" = 'elmer''s pet rabbit' | wikisql |
CREATE TABLE table_202_160 (
id number,
"season" number,
"level" text,
"division" text,
"section" text,
"position" text,
"movements" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many different divisions has the team participated in ?
| SELECT COUNT(DISTINCT "division") FROM table_202_160 | squall |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1561) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_it... | mimic_iii |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-1634') AND diagnosis.diagnosi... | eicu |
CREATE TABLE table_name_51 (
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Billy Casper's to par?
| SELECT to_par FROM table_name_51 WHERE player = "billy casper" | sql_create_context |
CREATE TABLE table_28859177_3 (
production_code VARCHAR,
original_air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the production code for the episode that aired on October 15, 2004?
| SELECT production_code FROM table_28859177_3 WHERE original_air_date = "October 15, 2004" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
... | SELECT jybgb.JYLX FROM jybgb WHERE jybgb.BGDH = '63570013997' | css |
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.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code | nvbench |
CREATE TABLE table_19246 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was everyone first elected when incumbent was John J. Hemphill?
| SELECT "First elected" FROM table_19246 WHERE "Incumbent" = 'John J. Hemphill' | wikisql |
CREATE TABLE table_16893 (
"Name" text,
"Number" text,
"Builder" text,
"Date built" text,
"Wheel arrangement" text,
"Driving wheels" text,
"Cylinders" text,
"Boiler pressure" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Notes" FROM table_16893 WHERE "Cylinders" = '12" x 17' | wikisql |
CREATE TABLE table_28794440_1 (
location VARCHAR,
callsign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where are the broadcasting companys with the callsign DWRH located?
| SELECT location FROM table_28794440_1 WHERE callsign = "DWRH" | sql_create_context |
CREATE TABLE table_203_16 (
id number,
"name" text,
"took office" text,
"left office" text,
"party" text,
"district residence" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of representatives from the ... | SELECT COUNT(*) FROM table_203_16 WHERE "party" = 'democratic' | squall |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 144... | mimic_iii |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_name_55 (
status VARCHAR,
unit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Status has a Unit of daohugou beds?
| SELECT status FROM table_name_55 WHERE unit = "daohugou beds" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | SELECT EMAIL, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID | nvbench |
CREATE TABLE table_name_18 (
total INTEGER,
gold VARCHAR,
bronze VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest metal total when the Bronze metals are larger than 0, the Gold medals are smaller than 1, and the natio... | SELECT MIN(total) FROM table_name_18 WHERE bronze > 0 AND nation = "switzerland" AND gold < 1 | sql_create_context |
CREATE TABLE table_66246 (
"Rank" real,
"Heat" real,
"Name" text,
"Nationality" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Melaine Walker's Rank?
| SELECT SUM("Rank") FROM table_66246 WHERE "Name" = 'melaine walker' | wikisql |
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numer... | SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY AVG(salary) | nvbench |
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(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_51 (
result VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which result has a Score of 30-44?
| SELECT result FROM table_name_51 WHERE score = "30-44" | sql_create_context |
CREATE TABLE table_61397 (
"Name" text,
"Bodyweight" real,
"Snatch" real,
"Clean & Jerk" real,
"Total (kg)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Snatch has a Clean & Jerk of 180, and a Bodyweight smaller than 69.83?
| SELECT MIN("Snatch") FROM table_61397 WHERE "Clean & Jerk" = '180' AND "Bodyweight" < '69.83' | wikisql |
CREATE TABLE table_name_33 (
date VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the score 0-0?
| SELECT date FROM table_name_33 WHERE score = "0-0" | sql_create_context |
CREATE TABLE table_name_21 (
career_sr VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 1999, when 2003 is 'A', and when Career SR is '0 / 4'?
| SELECT 1999 FROM table_name_21 WHERE 2003 = "a" AND career_sr = "0 / 4" | sql_create_context |
CREATE TABLE table_14814 (
"Overall Pick #" real,
"AFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what college has paul seiler as a player?
| SELECT "College" FROM table_14814 WHERE "Player" = 'paul seiler' | wikisql |
CREATE TABLE table_37356 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Class for the ERP W of more than 2 and the call sign of ... | SELECT "Class" FROM table_37356 WHERE "ERP W" > '2' AND "Call sign" = 'w223au' | wikisql |
CREATE TABLE table_27232 (
"Season" text,
"Date" text,
"Home team" text,
"Result" text,
"Away team" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date for the game at the tallaght stadium and result was 0 1?
| SELECT "Date" FROM table_27232 WHERE "Stadium" = 'Tallaght Stadium' AND "Result" = '0–1' | wikisql |
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 * FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '曹安卉' AND hz_info.YLJGDM = '4269180' AND mzjzjlb.JZZDSM LIKE '%人格障碍%' | css |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE table_204_712 (
id number,
"rank" number,
"athlete" text,
"nationality" text,
"time" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many competitors were from russia ?
| SELECT COUNT("athlete") FROM table_204_712 WHERE "nationality" = 'russia' | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.