instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_204_383 ( 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. -- how many total medals did china , japan , and south korea collect...
SELECT SUM("total") FROM table_204_383 WHERE "nation" IN ('china', 'japan', 'south korea')
squall
CREATE TABLE Order_Items ( order_item_id INTEGER, product_id INTEGER, order_id INTEGER, order_item_status VARCHAR(10), order_item_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_name VARCHAR(80), customer_details VARCHAR(255) ) CREATE TABLE Products ( ...
SELECT date_order_placed, COUNT(date_order_placed) FROM Orders AS T1 JOIN Shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10
nvbench
CREATE TABLE table_dev_19 ( "id" int, "glucagon_stimulated_c_peptide" float, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "diabetic" string, "hyperlipidemia" bool, "creatinine_clearance_cl" float, "total_cholesterol" int, "stimulated_c_peptide" float, "smoking" bool, ...
SELECT * FROM table_dev_19 WHERE diabetic = 'i' AND negative_basal = 1 AND stimulated_c_peptide = 1 OR (c_peptide_level < 0.2 AND glucagon_stimulated_c_peptide <= 0.8) AND diabetes = 1
criteria2sql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "T5 FRACTURE" AND procedures.icd9_code = "8105"
mimicsql_data
CREATE TABLE table_name_49 ( stage VARCHAR, trofeo_fast_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the stage of team Once?
SELECT stage FROM table_name_49 WHERE trofeo_fast_team = "once"
sql_create_context
CREATE TABLE table_56534 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result when the time was 5:00 and a rec...
SELECT "Res." FROM table_56534 WHERE "Time" = '5:00' AND "Record" = '14-4'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayNa...
SELECT Votes.UserId AS "user_link", CASE WHEN Votes.VoteTypeId = 2 THEN 'Upvote' WHEN Votes.VoteTypeId = 3 THEN 'Downvote' END AS "type", Votes.CreationDate, Votes.VoteTypeId FROM Votes WHERE Votes.PostId = '##PostId##'
sede
CREATE TABLE table_name_52 ( lost VARCHAR, match_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which lost has 84 as the match points?
SELECT lost FROM table_name_52 WHERE match_points = "84"
sql_create_context
CREATE TABLE table_60970 ( "Title" text, "Developer" text, "Category" text, "Release date" text, "Version" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Version has a Title of alarm clock?
SELECT "Version" FROM table_60970 WHERE "Title" = 'alarm clock'
wikisql
CREATE TABLE table_31199 ( "Skip (Club)" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest L of the ...
SELECT MAX("L") FROM table_31199
wikisql
CREATE TABLE table_204_354 ( id number, "opus" text, "title" text, "genre" text, "sub\u00addivisions" text, "libretto" text, "composition" text, "premiere date" text, "place, theatre" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- wh...
SELECT "title" FROM table_204_354 WHERE "composition" >= 1900 ORDER BY "composition" LIMIT 1
squall
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufac...
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'HOUSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTL...
atis
CREATE TABLE table_1341843_19 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the district that Otto Passman is the incumbent of?
SELECT district FROM table_1341843_19 WHERE incumbent = "Otto Passman"
sql_create_context
CREATE TABLE table_name_74 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date with a home team of melbourne
SELECT date FROM table_name_74 WHERE home_team = "melbourne"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( ...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_...
mimic_iii
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 WHERE demographic.language = "CAPE" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY"
mimicsql_data
CREATE TABLE table_24398 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When william b. campbell (u) is the successor what is the district?
SELECT "District" FROM table_24398 WHERE "Successor" = 'William B. Campbell (U)'
wikisql
CREATE TABLE table_204_219 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- number of points scored by miami -...
SELECT "result" FROM table_204_219 WHERE "opponent#" = 'miami (oh)'
squall
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT diagnoses.long_title, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "92796"
mimicsql_data
CREATE TABLE table_21629 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which seasons were directed by Nelson McCormick?
SELECT "Title" FROM table_21629 WHERE "Directed by" = 'Nelson McCormick'
wikisql
CREATE TABLE table_2578 ( "No. in series" text, "No. in season" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "U.S. viewers (millions)" FROM table_2578 WHERE "No. in season" = '12'
wikisql
CREATE TABLE table_204_828 ( id number, "whitworth size (in)" number, "core diameter (in)" number, "threads per inch" number, "pitch (in)" number, "tapping drill size" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which whitworth size is the on...
SELECT "whitworth size (in)" FROM table_204_828 WHERE "threads per inch" = 5
squall
CREATE TABLE table_name_94 ( votes INTEGER, rank VARCHAR, riding VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the lowest votes of the candidate ranked 5th and riding in victoria?
SELECT MIN(votes) FROM table_name_94 WHERE rank = "5th" AND riding = "victoria"
sql_create_context
CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDSM = '牙列缺失' AND jyjgzbb.JCZBDM = '492...
css
CREATE TABLE table_name_24 ( average_ratings VARCHAR, japanese_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the average ratings for ?
SELECT average_ratings FROM table_name_24 WHERE japanese_title = "プリマダム"
sql_create_context
CREATE TABLE table_21414 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who ha...
SELECT "High points" FROM table_21414 WHERE "Game" = '4'
wikisql
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id 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.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.BGDH = '16846879997'
css
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 (SELECT QTY * UNIVALENT FROM t_kc22 WHERE MED_EXP_DET_ID = '82601093874') = (SELECT AMOUNT FROM t_kc22 WHERE MED_EXP_DET_ID = '82601093874')
css
CREATE TABLE table_42350 ( "Race Title" text, "Circuit" text, "City / State" text, "Date" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What race did Glenn Seton win on the Sandown International Raceway circuit?
SELECT "Race Title" FROM table_42350 WHERE "Winner" = 'glenn seton' AND "Circuit" = 'sandown international raceway'
wikisql
CREATE TABLE table_70696 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Authority is set for Hauturu School?
SELECT "Authority" FROM table_70696 WHERE "Name" = 'hauturu school'
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "MCV"
mimicsql_data
CREATE TABLE table_name_43 ( ride_name VARCHAR, manufacturer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ride was manufactured by Zierer?
SELECT ride_name FROM table_name_43 WHERE manufacturer = "zierer"
sql_create_context
CREATE TABLE table_56181 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text, "Apparent magnitude" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For an apparent magnitude...
SELECT "Right ascension ( J2000 )" FROM table_56181 WHERE "Apparent magnitude" > '11.8'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Sodium, Urine"
mimicsql_data
CREATE TABLE table_name_16 ( color_commentator_s_ VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the color commentator in 2008?
SELECT color_commentator_s_ FROM table_name_16 WHERE year = 2008
sql_create_context
CREATE TABLE table_59527 ( "Result" text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of a round greater than 3?
SELECT "Result" FROM table_59527 WHERE "Round" > '3'
wikisql
CREATE TABLE table_71318 ( "School" text, "Location" text, "Total" real, "Crimean War" real, "Persian War" real, "Indian Mutiny" real, "1860-1878" real, "Zulu War" real, "Second Afghan War" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT COUNT("Persian War") FROM table_71318 WHERE "School" = 'rashtriya indian military college' AND "1860-1878" < '0'
wikisql
CREATE TABLE table_23670057_1 ( position VARCHAR, height__m_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the position for 2.16
SELECT position FROM table_23670057_1 WHERE height__m_ = "2.16"
sql_create_context
CREATE TABLE table_name_30 ( week VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks had an Attendance of 43,272?
SELECT COUNT(week) FROM table_name_30 WHERE attendance = "43,272"
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 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 '2006-08-01' AND '2016-01-03' AND t_kc22.SELF_PAY_AMO > 7190.67
css
CREATE TABLE table_203_741 ( id number, "season" text, "competition" text, "round" text, "opponent" text, "home" text, "away" text, "aggregate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the last opponent according to this ch...
SELECT "opponent" FROM table_203_741 ORDER BY id DESC LIMIT 1
squall
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 gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3916890' AND gwyjzb.IN_HOSP_DATE BETWEEN '2003-07-01' AND '2021-03-29' AND gwyjzb.REMOTE_SETTLE_FLG = '异地1' OR gwyjzb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3916890' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2003-07...
css
CREATE TABLE roller_coaster ( Status VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Please show the most common status of roller coasters.
SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1
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 SUM(t_kc24.PER_ACC_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '朱元纬' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-03-25' AND '2012-04-22' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '朱元纬' A...
css
CREATE TABLE table_name_99 ( round INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest round that Melvin Johnson played?
SELECT MIN(round) FROM table_name_99 WHERE player = "melvin johnson"
sql_create_context
CREATE TABLE table_14732 ( "Year" real, "Men's singles" text, "Women'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. -- Name the men's singles for when doubles are suresh...
SELECT "Men's singles" FROM table_14732 WHERE "Mixed doubles" = 'suresh goel morin d''souza'
wikisql
CREATE TABLE Apartment_Buildings ( building_short_name VARCHAR, building_manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the short names of the buildings managed by 'Emma'.
SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = "Emma"
sql_create_context
CREATE TABLE table_54274 ( "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 date did the away team score 13.10 (88)?
SELECT "Date" FROM table_54274 WHERE "Away team score" = '13.10 (88)'
wikisql
CREATE TABLE table_name_1 ( location VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of game 7?
SELECT location FROM table_name_1 WHERE game = 7
sql_create_context
CREATE TABLE table_18963 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the follo...
SELECT "Club" FROM table_18963 WHERE "Points for" = '565'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "74" AND procedures.short_title = "Form cutan ileoureterost"
mimicsql_data
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit...
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 54386 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ...
mimic_iii
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE party ( party_id number, minister text, took_office text, left_office text, region_id number, party_name text ) CREATE TABLE party_events ( event_id number, event_name text, party_id number, member_in_charge_id number ) CREATE TABLE region ( region_id number, ...
SELECT DISTINCT region_name FROM region ORDER BY label
spider
CREATE TABLE farm ( Farm_ID int, Year int, Total_Horses real, Working_Horses real, Total_Cattle real, Oxen real, Bulls real, Cows real, Pigs real, Sheep_and_Goats real ) CREATE TABLE farm_competition ( Competition_ID int, Year int, Theme text, Host_city_ID int, ...
SELECT Status, AVG(Population) FROM city GROUP BY Status ORDER BY Status DESC
nvbench
CREATE TABLE table_33961 ( "Element" text, "Wood" text, "Fire" text, "Earth" text, "Metal" text, "Water" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which water has green wood?
SELECT "Water" FROM table_33961 WHERE "Wood" = 'green'
wikisql
CREATE TABLE table_62717 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which PBA team has a College of nu?
SELECT "PBA team" FROM table_62717 WHERE "College" = 'nu'
wikisql
CREATE TABLE table_58998 ( "Title" text, "Developer" text, "Genre" text, "Release date" text, "Version" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Title, when Developer is '2Play Mobile', and when Genre is 'Action'?
SELECT "Title" FROM table_58998 WHERE "Developer" = '2play mobile' AND "Genre" = 'action'
wikisql
CREATE TABLE table_1341897_45 ( result VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the election in which Lindley Beckworth was the incumbent?
SELECT result FROM table_1341897_45 WHERE incumbent = "Lindley Beckworth"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college 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, additio...
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDat...
SELECT * FROM PostHistoryTypes
sede
CREATE TABLE table_17622423_12 ( high_points VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the high points for may 29
SELECT high_points FROM table_17622423_12 WHERE date = "May 29"
sql_create_context
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 demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.name = "Paul Dunn"
mimicsql_data
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2024" AND diagnoses.short_title = "Chronic liver dis NEC"
mimicsql_data
CREATE TABLE table_name_35 ( original_title VARCHAR, film_title_used_in_nomination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Original title, when Film title used in nomination is Train Without A Timetable?
SELECT original_title FROM table_name_35 WHERE film_title_used_in_nomination = "train without a timetable"
sql_create_context
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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 te...
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.BGDH = '61753289782'
css
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 COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.B...
css
CREATE TABLE table_name_15 ( station VARCHAR, height_above_sea_level__m_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which station that sat 54m above seal level is now Closed?
SELECT station FROM table_name_15 WHERE height_above_sea_level__m_ = "54m" AND "closed" = "closed"
sql_create_context
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department LIKE '%ORTHO%' AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "E8786" AND lab.flag = "abnormal"
mimicsql_data
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 WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA"
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 jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '2型糖尿病' AND jyjgzbb.JCZBMC = '低密度脂蛋白胆固醇'
css
CREATE TABLE table_26208 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the opponents in the fin...
SELECT "Opponents in the final" FROM table_26208 WHERE "Score in the final" = '6–4, 2–6, 6–4, 7–6(3)'
wikisql
CREATE TABLE table_name_64 ( round VARCHAR, opposing_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round has an Opposing Team of manchester united?
SELECT round FROM table_name_64 WHERE opposing_team = "manchester united"
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.short_title = "Adm inhal nitric oxide"
mimicsql_data
CREATE TABLE table_14865 ( "Year" text, "Men's singles" text, "Women'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 women's double took place in 2006?
SELECT "Women's doubles" FROM table_14865 WHERE "Year" = '2006'
wikisql
CREATE TABLE table_67189 ( "Year" real, "Film" text, "Director" text, "Nationality of director" text, "Award" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ilm of taukukauppiaat has how many total number of years?
SELECT COUNT("Year") FROM table_67189 WHERE "Film" = 'taukukauppiaat'
wikisql
CREATE TABLE table_name_96 ( title VARCHAR, imprint VARCHAR, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the title when the imprint is dengeki bunko and the artist is kiyotaka haimura?
SELECT title FROM table_name_96 WHERE imprint = "dengeki bunko" AND artist = "kiyotaka haimura"
sql_create_context
CREATE TABLE table_75528 ( "Date" text, "Home" text, "Score" text, "Visitor" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who visited on April 29?
SELECT "Visitor" FROM table_75528 WHERE "Date" = 'april 29'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime tim...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
mimic_iii
CREATE TABLE table_43261 ( "Week of" text, "Tier" text, "Winner" text, "Runner-up" text, "Semi finalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the semi finalists when Alexia Dechaume-Balleret Sandrine testud was the runner-up?
SELECT "Semi finalists" FROM table_43261 WHERE "Runner-up" = 'alexia dechaume-balleret sandrine testud'
wikisql
CREATE TABLE table_name_20 ( finish VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Finish of the Player with a Total of 273?
SELECT finish FROM table_name_20 WHERE total = 273
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) 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, departure_airlin...
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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id ...
atis
CREATE TABLE table_30819 ( "Pick" text, "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. -- What college team did Milan Kostolny play for?
SELECT "College/junior/club team" FROM table_30819 WHERE "Player" = 'Milan Kostolny'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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, JOB_ID varchar(10), ...
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT DESC
nvbench
CREATE TABLE perpetrator ( perpetrator_id number, people_id number, date text, year number, location text, country text, killed number, injured number ) CREATE TABLE people ( people_id number, name text, height number, weight number, home town text ) -- Using valid...
SELECT country, COUNT(*) FROM perpetrator GROUP BY country
spider
CREATE TABLE table_name_90 ( us_modern_rock VARCHAR, code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the US modern rock rank of code bad 0003?
SELECT us_modern_rock FROM table_name_90 WHERE code = "bad 0003"
sql_create_context
CREATE TABLE domain ( did int, name varchar ) CREATE TABLE writes ( aid int, pid int ) CREATE TABLE keyword ( keyword varchar, kid int ) CREATE TABLE domain_publication ( did int, pid int ) CREATE TABLE cite ( cited int, citing int ) CREATE TABLE conference ( cid int, ...
SELECT publication.title FROM author, conference, publication, writes WHERE author.name = 'H. V. Jagadish' AND conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.year > 2000 AND writes.aid = author.aid AND writes.pid = publication.pid
academic
CREATE TABLE table_name_35 ( year INTEGER, entrant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did Cooper Car Company enter?
SELECT AVG(year) FROM table_name_35 WHERE entrant = "cooper car company"
sql_create_context
CREATE TABLE table_name_26 ( total INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which mean total had Tim Sills as a player?
SELECT AVG(total) FROM table_name_26 WHERE player = "tim sills"
sql_create_context
CREATE TABLE table_name_2 ( poll_source VARCHAR, peg_luksik VARCHAR, dates_administered VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Poll source has a Peg Luksik of 9%, and Dates administered of may 12, 2010?
SELECT poll_source FROM table_name_2 WHERE peg_luksik = "9%" AND dates_administered = "may 12, 2010"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( ...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-38092')) AND medication.drugname = 'morphine sulfate' AND ...
eicu
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_na...
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, state WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name...
atis
CREATE TABLE table_6049 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the opponent from April 19?
SELECT "Opponent" FROM table_6049 WHERE "Date" = 'april 19'
wikisql
CREATE TABLE table_75846 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date has alamodome, san antonio, united states as the venue?
SELECT "Date" FROM table_75846 WHERE "Venue" = 'alamodome, san antonio, united states'
wikisql
CREATE TABLE table_name_81 ( week VARCHAR, tv_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Week of the game with TV Time of Fox 4:15ET?
SELECT COUNT(week) FROM table_name_81 WHERE tv_time = "fox 4:15et"
sql_create_context
CREATE TABLE table_31107 ( "Rank 2011" real, "Country" text, "Production in 2011 (1,000 ton)" real, "Share 2011" text, "Rank 2010" real, "Production in 2010 (1,000 ton)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 5 is the rank of 2011 w...
SELECT "Country" FROM table_31107 WHERE "Rank 2011" = '5'
wikisql
CREATE TABLE table_8920 ( "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 is Jay Haas from when he had a to par of E?
SELECT "Country" FROM table_8920 WHERE "To par" = 'e' AND "Player" = 'jay haas'
wikisql
CREATE TABLE table_26313 ( "Year" real, "Winner (number of titles)" text, "Runners-up" text, "Top Team in Regular Season (points)" text, "Top Scorer (points)" text, "Winning Coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the runner-up ...
SELECT "Winner (number of titles)" FROM table_26313 WHERE "Runners-up" = 'Fort Lauderdale Strikers'
wikisql