instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_23 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1996 when the 1994 is A, the 2003 is A, and the 2001 is 1R?
| SELECT 1996 FROM table_name_23 WHERE 1994 = "a" AND 2003 = "a" AND 2001 = "1r" | sql_create_context |
CREATE TABLE table_203_368 (
id number,
"date" text,
"opponent" text,
"venue" text,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the difference in points in the game on october 30th against bury ?
| SELECT "result" - "result" FROM table_203_368 WHERE "opponent" = 'bury' | squall |
CREATE TABLE table_name_55 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2004 value with A in 2005, A in 2008, and lq in 2009?
| SELECT 2004 FROM table_name_55 WHERE 2005 = "a" AND 2008 = "a" AND 2009 = "lq" | sql_create_context |
CREATE TABLE table_58581 (
"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 crowd attendance in the match at pu... | SELECT SUM("Crowd") FROM table_58581 WHERE "Venue" = 'punt road oval' | wikisql |
CREATE TABLE table_40372 (
"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.
-- Who was the away team when the home team Manchester United played?
| SELECT "Away team" FROM table_40372 WHERE "Home team" = 'manchester united' | wikisql |
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE management (
department_ID int,
head_ID int,
tempor... | SELECT Name, SUM(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE table_name_19 (
name VARCHAR,
investigation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the naame of Investigation of thrombus imaging
| SELECT name FROM table_name_19 WHERE investigation = "thrombus imaging" | sql_create_context |
CREATE TABLE table_204_185 (
id number,
"location" text,
"town" text,
"output (mw ac)" number,
"modules" number,
"number of arrays" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the only town with two project locations ?
| SELECT "town" FROM table_204_185 GROUP BY "town" HAVING COUNT("location") = 2 | squall |
CREATE TABLE table_62405 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country scored 66-68=134?
| SELECT "Country" FROM table_62405 WHERE "Score" = '66-68=134' | wikisql |
CREATE TABLE station (
id number,
name text,
lat number,
long number,
dock_count number,
city text,
installation_date text
)
CREATE TABLE weather (
date text,
max_temperature_f number,
mean_temperature_f number,
min_temperature_f number,
max_dew_point_f number,
mean_... | SELECT city FROM station GROUP BY city ORDER BY MAX(lat) DESC | spider |
CREATE TABLE table_77344 (
"Call sign" text,
"Frequency" text,
"City of license" text,
"State" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the call sign for 90.9 FM which is in Florida?
| SELECT "Call sign" FROM table_77344 WHERE "State" = 'florida' AND "Frequency" = '90.9 fm' | wikisql |
CREATE TABLE table_46412 (
"C/W 15+" real,
"Oblast\\Age" text,
"15 to 17" real,
"18 to 19" text,
"20 to 24" real,
"25 to 29" real,
"30 to 34" real,
"35 to 39" real,
"40 to 44" real,
"45 to 49" real,
"50 to 54" real,
"55 to 59" real,
"60 to 64" real,
"65 to 69" rea... | SELECT COUNT("C/W 15+") FROM table_46412 WHERE "55 to 59" < '1,677' AND "Oblast\\Age" = 'gorod moscow' AND "50 to 54" > '1,562' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE flight_stop (
flight_id in... | SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/57' | atis |
CREATE TABLE table_29194 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The episode with the original airdate October 8, 2010... | SELECT "Directed by" FROM table_29194 WHERE "Original airdate" = 'October 8, 2010' | wikisql |
CREATE TABLE table_name_56 (
rank INTEGER,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Rank of the Rowers with a Time of 7:30.92?
| SELECT SUM(rank) FROM table_name_56 WHERE time = "7:30.92" | sql_create_context |
CREATE TABLE table_name_40 (
gdp_per_capita__us$_ VARCHAR,
gdp__billion_us$_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the per-capita GDP of the country with an overall GDP of 80.955?
| SELECT gdp_per_capita__us$_ FROM table_name_40 WHERE gdp__billion_us$_ = "80.955" | sql_create_context |
CREATE TABLE table_39049 (
"Unit" text,
"Russian" text,
"Translation" text,
"Ratio" text,
"Cubic inches (exact)" text,
"Metric value" text,
"Imperial" text,
"US Customary" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How big in metric ... | SELECT "Metric value" FROM table_39049 WHERE "Ratio" = '1/20' | wikisql |
CREATE TABLE table_203_452 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who finished after will power... | SELECT "driver" FROM table_203_452 WHERE "pos" = (SELECT "pos" FROM table_203_452 WHERE "driver" = 'will power') + 1 | squall |
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 MIN(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30044)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... | mimic_iii |
CREATE TABLE table_36414 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opposing team during a game in the Pontiac Silverdome?
| SELECT "Opponent" FROM table_36414 WHERE "Location" = 'pontiac silverdome' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "OVERDOSE" AND demographic.days_stay = "69" | mimicsql_data |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19627 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.route = 'ip' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_78109 (
"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 did the away team score 8.7 (55)?
| SELECT "Venue" FROM table_78109 WHERE "Away team score" = '8.7 (55)' | wikisql |
CREATE TABLE table_name_60 (
team VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Team when the match was in buenos aires , argentina?
| SELECT team FROM table_name_60 WHERE location = "buenos aires , argentina" | sql_create_context |
CREATE TABLE table_name_53 (
nationality VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE NATIONALITY FOR SOUTHWESTERN OKLAHOMA?
| SELECT nationality FROM table_name_53 WHERE college = "southwestern oklahoma" | sql_create_context |
CREATE TABLE table_17997 (
"Season" real,
"Season Premiere Date" text,
"Season Finale Date" text,
"Winner" text,
"1st Runner Up" text,
"2nd Runner Up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the season finale of meiyang chang?
| SELECT "Season Finale Date" FROM table_17997 WHERE "Winner" = 'Meiyang Chang' | wikisql |
CREATE TABLE table_name_72 (
time VARCHAR,
heat VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Time that has the Heat of 1, and the Lane of 2?
| SELECT time FROM table_name_72 WHERE heat = 1 AND lane = 2 | sql_create_context |
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 procedures.icd9_code FROM procedures WHERE procedures.subject_id = "6983" | 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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ... | css |
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 gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '袁修雅' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 1137.71) UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '袁修雅' AND fgwyjzb.MED_... | css |
CREATE TABLE table_name_74 (
attendance VARCHAR,
tie_no VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Away team Swindon Town had a Tie no listing of Replay with what as an Attendance?
| SELECT attendance FROM table_name_74 WHERE tie_no = "replay" AND away_team = "swindon town" | sql_create_context |
CREATE TABLE table_204_202 (
id number,
"year" number,
"tournament" text,
"venue" text,
"result" text,
"rank" text,
"event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in how many meetings did kaseorg place 10th or better ?
| SELECT COUNT(*) FROM table_204_202 WHERE "rank" <= 10 | squall |
CREATE TABLE table_13085 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Reserved for (SC / ST /None) with a Name of... | SELECT "Reserved for ( SC / ST /None)" FROM table_13085 WHERE "Name" = 'goverdhan' | wikisql |
CREATE TABLE table_name_58 (
other_mozilla VARCHAR,
chrome VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percentage of users were using other Mozilla browsers during the period in which 9.00% were using Chrome?
| SELECT other_mozilla FROM table_name_58 WHERE chrome = "9.00%" | sql_create_context |
CREATE TABLE table_name_59 (
games VARCHAR,
medal VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At which games did Tunisia win a bronze in the men's 1500 m freestyle?
| SELECT games FROM table_name_59 WHERE medal = "bronze" AND event = "men's 1500 m freestyle" | sql_create_context |
CREATE TABLE table_2364 (
"Institution" text,
"Location" text,
"Year Joined" real,
"Affiliation" text,
"Enrollment" real,
"Mascot" text,
"Colors" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the affiliation of the hilltoppers masco... | SELECT "Affiliation" FROM table_2364 WHERE "Mascot" = 'Hilltoppers' | wikisql |
CREATE TABLE table_204_650 (
id number,
"season" number,
"level" number,
"name" text,
"position" text,
"nationality" text,
"international\ncaps" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what season comes after 1986
| SELECT "season" FROM table_204_650 WHERE "season" > 1986 ORDER BY "season" LIMIT 1 | squall |
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '033-22108... | eicu |
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(t_kc21.IN_DIAG_DIS_CD) FROM t_kc21 WHERE t_kc21.PERSON_ID = '22994447' AND t_kc21.IN_HOSP_DATE BETWEEN '2012-01-31' AND '2017-08-07' | css |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091')) AND intakeoutput.cellpath LIKE '%ou... | eicu |
CREATE TABLE match_result (
Rank int,
Club_ID int,
Gold int,
Big_Silver int,
Small_Silver int,
Bronze int,
Points int
)
CREATE TABLE club (
Club_ID int,
Club_name text,
Region text,
Start_year int
)
CREATE TABLE coach (
Coach_ID int,
Coach_name text,
Gender text... | SELECT Residence, COUNT(Residence) FROM player WHERE Occupation <> "Researcher" GROUP BY Residence ORDER BY COUNT(Residence) | nvbench |
CREATE TABLE table_name_27 (
name VARCHAR,
authority VARCHAR,
roll VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school has a state authority and a roll of 318?
| SELECT name FROM table_name_27 WHERE authority = "state" AND roll = 318 | sql_create_context |
CREATE TABLE table_27248 (
"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.
-- How many weeks total are there?
| SELECT MAX("Week") FROM table_27248 | wikisql |
CREATE TABLE player (
player_id text,
birth_year text,
birth_month text,
birth_day text,
birth_country text,
birth_state text,
birth_city text,
death_year text,
death_month text,
death_day text,
death_country text,
death_state text,
death_city text,
name_first tex... | SELECT league_id FROM player_award WHERE year = "2006" GROUP BY league_id ORDER BY COUNT(*) DESC LIMIT 1 | thehistoryofbaseball |
CREATE TABLE table_79975 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Maxim Podoprigora's lowest rank?
| SELECT MIN("Rank") FROM table_79975 WHERE "Name" = 'maxim podoprigora' | wikisql |
CREATE TABLE table_name_83 (
type VARCHAR,
course VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type has rest day as a course and was on 21 may?
| SELECT type FROM table_name_83 WHERE course = "rest day" AND date = "21 may" | sql_create_context |
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 mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '64012281' AND hz_info.YLJGDM = '9057855' AND mzjzjlb.JZKSMC LIKE '%男科%' | css |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN 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 jy... | css |
CREATE TABLE table_name_44 (
city_of_license VARCHAR,
call_sign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city of license is associated with call sign w244bk?
| SELECT city_of_license FROM table_name_44 WHERE call_sign = "w244bk" | sql_create_context |
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 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 <= 6) | css |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course, program, program_course WHERE program_course.course_id = course.course_id AND program.name LIKE 'CS-LSA' AND program.program_id = program_course.program_id | advising |
CREATE TABLE addresses (
address_id number,
line_1_number_building text,
city text,
zip_postcode text,
state_province_county text,
country text
)
CREATE TABLE vehicles (
vehicle_id number,
vehicle_details text
)
CREATE TABLE lessons (
lesson_id number,
customer_id number,
l... | SELECT COUNT(*) FROM lessons AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE "%a%" | spider |
CREATE TABLE table_61109 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which To par has a Year(s) won of 1983?
| SELECT "To par" FROM table_61109 WHERE "Year(s) won" = '1983' | wikisql |
CREATE TABLE table_name_79 (
loss VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the loss for June 2?
| SELECT loss FROM table_name_79 WHERE date = "june 2" | sql_create_context |
CREATE TABLE table_273617_6 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest 2011 number (,000)?
| SELECT MIN(2011 AS _number__), 000 AS _ FROM table_273617_6 | sql_create_context |
CREATE TABLE table_31654 (
"Year" real,
"Division" text,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which division was the Rampage in when they were in the 2nd round in the Open ... | SELECT "Division" FROM table_31654 WHERE "Open Cup" = '2nd round' | wikisql |
CREATE TABLE table_203_739 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which nation received the largest amount of gold medals ?
| SELECT "nation" FROM table_203_739 ORDER BY "gold" DESC LIMIT 1 | squall |
CREATE TABLE table_name_39 (
stroke VARCHAR,
max_power VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What stroke has a max power of 109 ps(80kw)@4000 rpm?
| SELECT stroke FROM table_name_39 WHERE max_power = "109 ps(80kw)@4000 rpm" | sql_create_context |
CREATE TABLE table_48898 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Week has a Result of l 41-14?
| SELECT MIN("Week") FROM table_48898 WHERE "Result" = 'l 41-14' | wikisql |
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE... | SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims) ORDER BY COUNT(Date_Claim_Made) | nvbench |
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 COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '40200914' AND t_kc22.STA_DATE BETWEEN '2007-11-20' AND '2017-11-08' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_204_763 (
id number,
"county" text,
"km" number,
"intersecting road" text,
"notes" text,
"coordinates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many intersecting roads come after highway 9 ?
| SELECT COUNT("intersecting road") FROM table_204_763 WHERE id > (SELECT id FROM table_204_763 WHERE "intersecting road" = 'hwy 9') | squall |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '4998470' AND mzjzjlb.JZKSRQ BETWEEN '2010-09-19' AND '2020-11-18' AND mzjzjlb.WDBZ > 0 | css |
CREATE TABLE table_name_29 (
hull_no VARCHAR,
commissioned__decommissioned VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the hull number of Commissioned Decommissioned of 1973 1996
| SELECT hull_no FROM table_name_29 WHERE commissioned__decommissioned = "1973–1996" | sql_create_context |
CREATE TABLE table_12175 (
"Position" real,
"Club" text,
"Games played" text,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many loses... | SELECT SUM("Loses") FROM table_12175 WHERE "Points" > '30' AND "Goals scored" > '59' AND "Position" > '5' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "23875" AND prescriptions.route = "NEB" | mimicsql_data |
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 jybgb.BGJGDM, jybgb.BGJGMC FROM jybgb WHERE jybgb.BGDH = '75676535019' | css |
CREATE TABLE table_22916979_1 (
state VARCHAR,
population_density__people_per_mi_2__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many states had a population density of 10188.8?
| SELECT COUNT(state) FROM table_22916979_1 WHERE population_density__people_per_mi_2__ = "10188.8" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1789276' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) D... | css |
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '马兴生' AND t_kc22.STA_DATE BETWEEN '2004-04-23' AND '2010-10-25' AND t_kc22.SELF_PAY_AMO > 2352.85 | css |
CREATE TABLE table_32712 (
"Team" text,
"Bowl" text,
"Season coach" text,
"Interim head coach" text,
"Result" text,
"2008 head coach" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team lost under interim head coach, Dewayne Walker?
| SELECT "Team" FROM table_32712 WHERE "Result" = 'lost' AND "Interim head coach" = 'dewayne walker' | wikisql |
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 COUNT(*) FROM t_kc21 WHERE PERSON_ID = '31926697' AND CLINIC_TYPE = '住院' AND MOD(MED_AMOUT, 1) = 0 | css |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TA... | SELECT COUNT(*) AS "Users participating in the strike" FROM Users WHERE LOWER(DisplayName) LIKE '%reinstate%monica%' | sede |
CREATE TABLE table_name_25 (
high_rebounds VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the player with the High rebounds when there was a Score of l 108 114 (ot)?
| SELECT high_rebounds FROM table_name_25 WHERE score = "l 108–114 (ot)" | sql_create_context |
CREATE TABLE table_18148 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the elections take place in district Maryland 2?
| SELECT MIN("First elected") FROM table_18148 WHERE "District" = 'Maryland 2' | wikisql |
CREATE TABLE table_38239 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the week 16 game?
| SELECT "Date" FROM table_38239 WHERE "Week" = '16' | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" AND demographic.dod_year <= "2154.0" | mimicsql_data |
CREATE TABLE table_78202 (
"Pick" real,
"Round" text,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did the player from East Texas State play?
| SELECT "Position" FROM table_78202 WHERE "School" = 'east texas state' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | SELECT JZKSDM, JZKSMC FROM zyjzjlb WHERE JZLSH = '27490832854' | css |
CREATE TABLE table_62150 (
"Pick #" real,
"Player" text,
"Nationality" text,
"Position" text,
"NHL team" text,
"Team from" text,
"League from" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which League from has a Player of louis domingue?
| SELECT "League from" FROM table_62150 WHERE "Player" = 'louis domingue' | wikisql |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2154" AND procedures.short_title = "Endosc destruc esoph les" | mimicsql_data |
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 chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WH... | mimic_iii |
CREATE TABLE table_10138 (
"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.
-- Which date was corio oval the venue?
| SELECT "Date" FROM table_10138 WHERE "Venue" = 'corio oval' | wikisql |
CREATE TABLE company (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many gas companies are there?
| SELECT COUNT(*) FROM company | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NA... | SELECT FIRST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID 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.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue DESC | nvbench |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3507')) AND microlab.culturesite = 'stool' | eicu |
CREATE TABLE table_name_73 (
place VARCHAR,
season VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place result was the 1996 season at Lake Louise, Canada?
| SELECT place FROM table_name_73 WHERE season = 1996 AND location = "lake louise, canada" | sql_create_context |
CREATE TABLE table_name_14 (
digital_psip VARCHAR,
broadcast_channel VARCHAR,
call_sign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Digital PSIP for channels over 15 with callsign CFTU-DT?
| SELECT digital_psip FROM table_name_14 WHERE broadcast_channel > 15 AND call_sign = "cftu-dt" | sql_create_context |
CREATE TABLE table_67082 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lane number of the swimmer with a time of 55.69?
| SELECT "Lane" FROM table_67082 WHERE "Time" = '55.69' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'anxiety' AND DATETIME(diagnosis.diagnosistim... | eicu |
CREATE TABLE table_2290097_4 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum for 2nd runner-up?
| SELECT MIN(2 AS nd_runner_up) FROM table_2290097_4 | sql_create_context |
CREATE TABLE table_name_19 (
new_channel_s_ VARCHAR,
programme VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What channel is Gladiators on?
| SELECT new_channel_s_ FROM table_name_19 WHERE programme = "gladiators" | sql_create_context |
CREATE TABLE table_32006 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What rank is Belarus (BLR), which earned 15 medals total?
| SELECT MAX("Rank") FROM table_32006 WHERE "Nation" = 'belarus (blr)' AND "Total" < '15' | wikisql |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
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 varch... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%ARABIC%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | advising |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 57023 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.s... | mimic_iii |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAno... | SELECT q.Id AS "post_link", q.Title, q.OwnerUserId AS "user_link", q.Score, q.Tags, q.CreationDate FROM Posts AS q WHERE (PostTypeId = 1) AND (q.Body LIKE '%##word?urgent##%' COLLATE Latin1_General_CI_AI) ORDER BY q.Id DESC LIMIT 100 | sede |
CREATE TABLE table_name_43 (
level VARCHAR,
points VARCHAR,
goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the level when points are larger than 25, and goals are 64 31?
| SELECT level FROM table_name_43 WHERE points > 25 AND goals = "64–31" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.