instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_69809 (
"Year" text,
"Men's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Men's singles has a Mixed doubles of kai abraham petra michalowsky?
| SELECT "Men's singles" FROM table_69809 WHERE "Mixed doubles" = 'kai abraham petra michalowsky' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.dod_year <= "2111.0" | mimicsql_data |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
... | SELECT meter_500, ID FROM swimmer ORDER BY ID | nvbench |
CREATE TABLE table_204_223 (
id number,
"party" text,
"previous council" number,
"staying councillors" number,
"seats up for election" number,
"election result" number,
"new council" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which par... | SELECT "party" FROM table_204_223 ORDER BY "previous council" DESC LIMIT 1 | squall |
CREATE TABLE table_24536 (
"No. in total" text,
"No. in series" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number in series is 'Judas Kiss'?
| SELECT "No. in series" FROM table_24536 WHERE "Title" = 'Judas Kiss' | wikisql |
CREATE TABLE table_43323 (
"Competition" text,
"Ladder Position" text,
"Coach" text,
"Captain(s)" text,
"Details" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the coach of the 2010 Gold Coast Titans season?
| SELECT "Coach" FROM table_43323 WHERE "Details" = '2010 gold coast titans season' | wikisql |
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 prescriptions.route, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Promethazine HCl" | mimicsql_data |
CREATE TABLE table_77957 (
"Series" text,
"Monday" text,
"Tuesday" text,
"Thursday" text,
"Saturday" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which series airs Saturday on Channel 5?
| SELECT "Series" FROM table_77957 WHERE "Saturday" = 'channel 5' | wikisql |
CREATE TABLE table_name_91 (
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the 2nd round opponent when Team 2 is Red Star (D1)?
| SELECT 2 AS nd_round FROM table_name_91 WHERE team_2 = "red star (d1)" | sql_create_context |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperdataset (
paperid int,
... | SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid GROUP BY writes.authorid | scholar |
CREATE TABLE table_train_28 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"systemic_antifungal_therapy" bool,
"child_pugh_class" string,
"invasive_candida_infection" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables pr... | SELECT * FROM table_train_28 WHERE child_pugh_class = 'c' | criteria2sql |
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 jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '37939837213') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '37939837213') AND jyjgzbb.JCZBJGDL < (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '37939837213') | css |
CREATE TABLE table_name_56 (
score VARCHAR,
assist_pass VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score on 2010-07-13 when Abby wambach had the assist/pass?
| SELECT score FROM table_name_56 WHERE assist_pass = "abby wambach" AND date = "2010-07-13" | sql_create_context |
CREATE TABLE table_39176 (
"Team" text,
"Copa Libertadores 1999" text,
"Copa Mercosur 1999" text,
"Copa CONMEBOL 1999" text,
"Intercontinental Cup 1999" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Intercontinental Cup 1999 result for ... | SELECT "Intercontinental Cup 1999" FROM table_39176 WHERE "Copa CONMEBOL 1999" = 'runner-up' | wikisql |
CREATE TABLE table_72335 (
"Colt model no." text,
"Name" text,
"Stock" text,
"Fire control" text,
"Rear sight" text,
"Forward assist" text,
"Case deflector" text,
"Barrel length" text,
"Barrel profile" text,
"Barrel twist" text,
"Hand guards" text,
"Bayonet Lug" text,
... | SELECT "Rear sight" FROM table_72335 WHERE "Colt model no." = '735' | wikisql |
CREATE TABLE table_53714 (
"engine name" text,
"engine code(s)" text,
"valvetrain" text,
"displacement" text,
"max. power at rpm" text,
"max. torque at rpm" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the engine name that has a maximu... | SELECT "engine name" FROM table_53714 WHERE "max. torque at rpm" = 'n·m ( lbf·ft ) @ 3,800' | wikisql |
CREATE TABLE table_25505246_7 (
round VARCHAR,
against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of round was played when Hanne Skak Jensen faced Austria?
| SELECT round FROM table_25505246_7 WHERE against = "Austria" | sql_create_context |
CREATE TABLE table_63667 (
"Restaurant Name" text,
"Original Name" text,
"Location" text,
"Chef" text,
"Designer" text,
"Still Open?" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- is the restaurant bacchus roti with meredith heron as the design... | SELECT "Still Open?" FROM table_63667 WHERE "Designer" = 'meredith heron' AND "Restaurant Name" = 'bacchus roti' | wikisql |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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,
... | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjz... | css |
CREATE TABLE table_23214055_2 (
ezhavas VARCHAR,
muslims VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the ezhavas for muslims being 5.4
| SELECT ezhavas FROM table_23214055_2 WHERE muslims = "5.4" | sql_create_context |
CREATE TABLE gwyjzb (
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_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '9461389' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY... | css |
CREATE TABLE table_1342256_40 (
candidates VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the candidate for south carolina 3?
| SELECT candidates FROM table_1342256_40 WHERE district = "South Carolina 3" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.label = "Metamyelocytes" | mimicsql_data |
CREATE TABLE table_16965 (
"Series no." 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.
-- What was the airdate of 21 series number?
| SELECT "Original air date" FROM table_16965 WHERE "Series no." = '21' | wikisql |
CREATE TABLE table_7846 (
"Species" text,
"Species common name" text,
"NCBI Accession Number (mRNA/Protein)" text,
"Length (bp/aa)" text,
"Protein Identity" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Species has the Species common name list... | SELECT "Species" FROM table_7846 WHERE "Species common name" = 'mouse' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,... | SELECT Score, PostId AS "post_link", Id AS "comment_link", UserId AS "user_link" FROM Comments ORDER BY Score DESC LIMIT 10000 | sede |
CREATE TABLE table_name_73 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was in 2007 that is from 2004 0f 2r and 2010 of A?
| SELECT 2007 FROM table_name_73 WHERE 2004 = "2r" AND 2010 = "a" | sql_create_context |
CREATE TABLE table_33967 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest round where a back named Ed Cody can be found?
| SELECT MAX("Round") FROM table_33967 WHERE "Position" = 'back' AND "Player" = 'ed cody' | wikisql |
CREATE TABLE affected_region (
region_id number,
storm_id number,
number_city_affected number
)
CREATE TABLE region (
region_id number,
region_code text,
region_name text
)
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions... | SELECT AVG(damage_millions_usd), MAX(damage_millions_usd) FROM storm WHERE max_speed > 1000 | spider |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty_Participates_in (
Fac... | SELECT FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.FacID | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT diagnoses.short_title, prescriptions.drug_type FROM diagnoses INNER JOIN prescriptions ON diagnoses.hadm_id = prescriptions.hadm_id WHERE diagnoses.subject_id = "74032" | mimicsql_data |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id | advising |
CREATE TABLE View_Product_Availability (
product_id INTEGER,
booking_id INTEGER,
status_date DATETIME,
available_yn VARCHAR(1)
)
CREATE TABLE Products_Booked (
booking_id INTEGER,
product_id INTEGER,
returned_yn VARCHAR(1),
returned_late_yn VARCHAR(1),
booked_count INTEGER,
book... | SELECT payment_date, COUNT(payment_date) FROM Payments WHERE amount_paid > 300 OR payment_type_code = 'Check' ORDER BY COUNT(payment_date) DESC | nvbench |
CREATE TABLE table_name_85 (
original_title VARCHAR,
director VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the original title directed by luis bu uel
| SELECT original_title FROM table_name_85 WHERE director = "luis buñuel" | sql_create_context |
CREATE TABLE table_name_18 (
road_number VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many road numbers are before 1922?
| SELECT COUNT(road_number) FROM table_name_18 WHERE year < 1922 | sql_create_context |
CREATE TABLE table_77906 (
"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 at home?
| SELECT "Date" FROM table_77906 WHERE "Home team" = 'south melbourne' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
... | SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3369) AND microbiologyevents.spec_type_desc = 'mini-bal' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.charttime)... | mimic_iii |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester... | advising |
CREATE TABLE table_65077 (
"Peak" text,
"Country" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Col (m)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Col entry for the peak with an elevation of 2,308 meters?
| SELECT COUNT("Col (m)") FROM table_65077 WHERE "Elevation (m)" = '2,308' | wikisql |
CREATE TABLE table_202_281 (
id number,
"date" text,
"time (edt)" number,
"team #1" text,
"res." text,
"team #2" text,
"round" text,
"spectators" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the difference in number of specta... | SELECT (SELECT "spectators" FROM table_202_281 ORDER BY "spectators" DESC LIMIT 1) - (SELECT "spectators" FROM table_202_281 ORDER BY "spectators" LIMIT 1) | squall |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLin... | SELECT year_, month_, SUM(CASE WHEN down > 0 THEN 1 ELSE 0 END) AS bad_days FROM (SELECT YEAR(CreationDate) AS year_, MONTH(CreationDate) AS month_, MAX(CASE WHEN Score > 0 THEN 1 ELSE 0 END) AS up, MAX(CASE WHEN Score < 1 THEN 1 ELSE 0 END) AS down FROM Posts WHERE OwnerUserId = '##UserId##' AND PostTypeId = 1 GROUP B... | sede |
CREATE TABLE roles (
role_code text,
role_name text,
role_description text
)
CREATE TABLE employees (
employee_id number,
role_code text,
employee_name text,
gender_mfu text,
date_of_birth time,
other_details text
)
CREATE TABLE document_locations (
document_id number,
loca... | SELECT employee_name FROM employees WHERE role_code = "HR" | spider |
CREATE TABLE table_71341 (
"Year" real,
"Title" text,
"Role" text,
"Language" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What role is spoken in hindi in 2011?
| SELECT "Role" FROM table_71341 WHERE "Language" = 'hindi' AND "Year" = '2011' | wikisql |
CREATE TABLE table_74430 (
"Date" text,
"Episode" real,
"Official rating 4+" text,
"Share 4+" text,
"Official rating 16-39" text,
"Share 16-39" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 16-39 share of the episode with a 4+ share... | SELECT "Share 16-39" FROM table_74430 WHERE "Share 4+" = '30,01%' | wikisql |
CREATE TABLE store_district (
Store_ID int,
District_ID int
)
CREATE TABLE district (
District_ID int,
District_name text,
Headquartered_City text,
City_Population real,
City_Area real
)
CREATE TABLE store (
Store_ID int,
Store_Name text,
Type text,
Area_size real,
Numb... | SELECT Headquartered_City, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.Store_ID = t2.Store_ID JOIN district AS t3 ON t2.District_ID = t3.District_ID GROUP BY t3.Headquartered_City ORDER BY Headquartered_City | nvbench |
CREATE TABLE table_201_13 (
id number,
"city" text,
"county(ies)" text,
"population\n(2000 census)" number,
"population\n(2010 census)" number,
"class" text,
"incorporation\ndate" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which city h... | SELECT "city" FROM table_201_13 ORDER BY "population\n(2010 census)" DESC LIMIT 1 | squall |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid nu... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'ampicillin') AND STRFTIME('%y', cost.chargetime) <= '2104' GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE table_15681686_4 (
rank__week_ VARCHAR,
viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what rank has viewers at 6.45?
| SELECT rank__week_ FROM table_15681686_4 WHERE viewers__millions_ = "6.45" | sql_create_context |
CREATE TABLE table_29015 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was drafted to litvinov (czechoslovakia)?
| SELECT "Player" FROM table_29015 WHERE "College/junior/club team" = 'Litvinov (Czechoslovakia)' | wikisql |
CREATE TABLE table_44403 (
"Poll Source" text,
"Date administered" text,
"Democrat" text,
"Republican" text,
"Lead Margin" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Lead Margin has a Poll Source of rasmussen reports/ fox news?
| SELECT MIN("Lead Margin") FROM table_44403 WHERE "Poll Source" = 'rasmussen reports/ fox news' | wikisql |
CREATE TABLE table_train_141 (
"id" int,
"gender" string,
"hypothyroidism" bool,
"depression" bool,
"mini_mental_state_examination_mmse" int,
"neuropsychiatric_diagnoses" bool,
"memory_box" float,
"early_stage_ad" bool,
"head_injury" bool,
"stroke" bool,
"body_weight" float,
... | SELECT * FROM table_train_141 WHERE major_medical_illness = 1 OR (diabetes = 1 OR hypertension = 1 OR hypertension = 1 OR hypothyroidism = 1) | criteria2sql |
CREATE TABLE Rooms (
roomName VARCHAR,
decor VARCHAR,
basePrice VARCHAR,
beds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the names of all modern rooms with a base price below $160 and two beds.
| SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern' | sql_create_context |
CREATE TABLE table_name_89 (
first_issue VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the First Issue date of Bamboo Blade?
| SELECT first_issue FROM table_name_89 WHERE title = "bamboo blade" | sql_create_context |
CREATE TABLE table_name_86 (
venue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue was used 22 january 2008?
| SELECT venue FROM table_name_86 WHERE date = "22 january 2008" | 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_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '04369427' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '拉莫三嗪片') | css |
CREATE TABLE table_name_61 (
main_campus_location VARCHAR,
founded VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college was founded in 1967?
| SELECT main_campus_location FROM table_name_61 WHERE founded = 1967 | sql_create_context |
CREATE TABLE table_32767 (
"Freq" real,
"Call" text,
"City" text,
"Owner" text,
"Day Power ( W )" real,
"Night Power" real,
"Format" text,
"Stereo" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Is WPEO in stereo?
| SELECT "Stereo" FROM table_32767 WHERE "Call" = 'wpeo' | wikisql |
CREATE TABLE table_28784 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Patient Portrayer" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the original air date fo... | SELECT "Original air date" FROM table_28784 WHERE "Patient Portrayer" = 'Julie Warner' | wikisql |
CREATE TABLE table_name_41 (
goals INTEGER,
apps INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Goals have Apps smaller than 1?
| SELECT AVG(goals) FROM table_name_41 WHERE apps < 1 | sql_create_context |
CREATE TABLE table_56612 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the game played with a home team score... | SELECT "Venue" FROM table_56612 WHERE "Home team score" = '8.13 (61)' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 24 AND date_day.month_number = 5... | atis |
CREATE TABLE table_32562 (
"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 Melbourne's score when they were the ho... | SELECT "Home team score" FROM table_32562 WHERE "Home team" = 'melbourne' | wikisql |
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 All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home | nvbench |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2103') AS t1) - (SELECT C... | eicu |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'LAW' AND cour... | advising |
CREATE TABLE table_42425 (
"Year" real,
"Champions" text,
"Result" text,
"Runners-up" text,
"Playoffs MVP" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result for the champions jeonju kcc egis with runners-up seoul samsung thunders aft... | SELECT "Result" FROM table_42425 WHERE "Year" > '2007' AND "Runners-up" = 'seoul samsung thunders' AND "Champions" = 'jeonju kcc egis' | wikisql |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age) | nvbench |
CREATE TABLE table_204_178 (
id number,
"number" text,
"south/west end" text,
"north/east end" text,
"formed" text,
"eliminated" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many routes were formed in 1926 ?
| SELECT COUNT("number") FROM table_204_178 WHERE "formed" = 1926 | squall |
CREATE TABLE table_name_83 (
label VARCHAR,
region VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What label has the netherlands as the region, and magik muzik 802-1 as the catalog?
| SELECT label FROM table_name_83 WHERE region = "netherlands" AND catalog = "magik muzik 802-1" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15447 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_40 (
gamerankings VARCHAR,
metacritic VARCHAR,
year_released VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the GameRankings Released of 2011 with a Metacritic of 83/100?
| SELECT gamerankings FROM table_name_40 WHERE metacritic = "83/100" AND year_released = 2011 | sql_create_context |
CREATE TABLE table_203_74 (
id number,
"rank" number,
"urban area" text,
"population\n(2001 census)" number,
"area (km2)" number,
"density (people/km2)" number,
"major subdivisions" text,
"metropolitan area" text
)
-- Using valid SQLite, answer the following questions for the tables pr... | SELECT "area (km2)" FROM table_203_74 WHERE "urban area" = 'edinburgh' | squall |
CREATE TABLE country (
Country_id VARCHAR,
Country_name VARCHAR
)
CREATE TABLE match_season (
Player VARCHAR,
Country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which players are from Indonesia?
| SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = "Indonesia" | sql_create_context |
CREATE TABLE table_19534677_1 (
creators VARCHAR,
volume_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the umbr of creators for flash of two worlds
| SELECT COUNT(creators) FROM table_19534677_1 WHERE volume_title = "Flash of Two Worlds" | sql_create_context |
CREATE TABLE table_name_80 (
year INTEGER,
billboard_200_peak VARCHAR,
riaa_sales_certification VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For how many years did the song 'Lost Without Your Love' win the gold RIAA Sales Certificati... | SELECT SUM(year) FROM table_name_80 WHERE riaa_sales_certification = "gold" AND title = "lost without your love" AND billboard_200_peak > 26 | sql_create_context |
CREATE TABLE table_name_31 (
attendance INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance on 10 november 2004?
| SELECT AVG(attendance) FROM table_name_31 WHERE date = "10 november 2004" | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time 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, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (((DATE_DAY_0.day_number = 23 AND DATE_DAY_0.month... | atis |
CREATE TABLE table_27147 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the game site for the ma... | SELECT "Game site" FROM table_27147 WHERE "Opponent" = 'Frankfurt Galaxy' | wikisql |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,... | SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.number = 783 AND course_offering.semester = semester.semester_id AND instructor.name LIKE '%Ching Lee%' AND offering_instructor.instructo... | advising |
CREATE TABLE school_bus (
school_id number,
driver_id number,
years_working number,
if_full_time others
)
CREATE TABLE driver (
driver_id number,
name text,
party text,
home_city text,
age number
)
CREATE TABLE school (
school_id number,
grade text,
school text,
loc... | SELECT party, COUNT(*) FROM driver GROUP BY party | spider |
CREATE TABLE table_77658 (
"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 was the game played at Lake Oval?
| SELECT "Date" FROM table_77658 WHERE "Venue" = 'lake oval' | wikisql |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
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... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... | atis |
CREATE TABLE 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 person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJG... | 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 T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name | nvbench |
CREATE TABLE table_291 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"MLB Draft" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players have the hometown Pennsauken, NJ?
| SELECT COUNT("Player") FROM table_291 WHERE "Hometown" = 'Pennsauken, NJ' | wikisql |
CREATE TABLE table_name_49 (
mixed_doubles VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the Mixed Doubles in 2007?
| SELECT mixed_doubles FROM table_name_49 WHERE year = "2007" | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number... | SELECT CASE WHEN PostTypeId = 1 THEN '<hr>' ELSE '' END + '<div>' + '<div>' + Title + '</div>' + '</div>' AS html FROM (SELECT q.Title, '//stackoverflow.com/q/' + CAST(p.Id AS TEXT) AS anchor, CASE WHEN p.PostTypeId = 1 THEN q.Title ELSE 'answer' END AS anchortext, p.Body, q.Tags, q.Score, p.PostTypeId, COALESCE(p.Pare... | sede |
CREATE TABLE table_name_24 (
lost INTEGER,
goals_against VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many losses have 222 as the goals against, with points greater than 78?
| SELECT SUM(lost) FROM table_name_24 WHERE goals_against = 222 AND points > 78 | sql_create_context |
CREATE TABLE table_name_4 (
semifinal VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Hossein Ojaghi participated in what semifinal.
| SELECT semifinal FROM table_name_4 WHERE athlete = "hossein ojaghi" | sql_create_context |
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 demographic (... | SELECT demographic.age FROM demographic WHERE demographic.subject_id = "3343" | mimicsql_data |
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,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT zyjzjlb.ZYZYZDZZBM, zyjzjlb.ZYZYZDZZMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '65356783060' | css |
CREATE TABLE table_name_24 (
result VARCHAR,
game_site VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for the game at Memorial Stadium in week 15?
| SELECT result FROM table_name_24 WHERE game_site = "memorial stadium" AND week = 15 | sql_create_context |
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 HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID) DESC | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND lab.label = "Amylase" | mimicsql_data |
CREATE TABLE Grants (
grant_id INTEGER,
organisation_id INTEGER,
grant_amount DECIMAL(19,4),
grant_start_date DATETIME,
grant_end_date DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Organisations (
organisation_id INTEGER,
organisation_type VARCHAR(10),
organisation_details VAR... | SELECT organisation_details, COUNT(organisation_details) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY organisation_details ORDER BY COUNT(organisation_details) DESC | nvbench |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND diagnoses.icd9_code = "56210" | mimicsql_data |
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grade varchar(2)
)
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... | SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) ORDER BY budget | nvbench |
CREATE TABLE table_name_82 (
tns_sofres_5_26_09 VARCHAR,
ipsos_5_25_09 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which TNS-Sofres 5/26/09 has an Ipsos 5/25/09 of 1%?
| SELECT tns_sofres_5_26_09 FROM table_name_82 WHERE ipsos_5_25_09 = "1%" | sql_create_context |
CREATE TABLE table_name_27 (
drawn INTEGER,
lost VARCHAR,
points VARCHAR,
against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of draws with more than 15 points, an against of 19, and less than 3 losses?
| SELECT MAX(drawn) FROM table_name_27 WHERE points > 15 AND against = 19 AND lost < 3 | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "56" AND prescriptions.drug = "Voriconazole" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.