instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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_Road, School_ID FROM basketball_match ORDER BY All_Road DESC
nvbench
CREATE TABLE table_21002034_7 ( _number INTEGER, air_date_netherlands_yyyy_mm_dd VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most number for air date 2009/12/29
SELECT MAX(_number) FROM table_21002034_7 WHERE air_date_netherlands_yyyy_mm_dd = "2009/12/29"
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 t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '25361581' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 1538.07)
css
CREATE TABLE table_name_26 ( score VARCHAR, partnering VARCHAR, opponents_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Partnering is 'Alexander Waske', and when Opponents In The Final is 'Rafael Nadal Bartolom Salv -Vid...
SELECT score FROM table_name_26 WHERE partnering = "alexander waske" AND opponents_in_the_final = "rafael nadal bartolomé salvá-vidal"
sql_create_context
CREATE TABLE table_name_49 ( country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a Score of 79-68-74=212?
SELECT country FROM table_name_49 WHERE score = 79 - 68 - 74 = 212
sql_create_context
CREATE TABLE table_name_11 ( year INTEGER, region VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the highest Year with the Region of Southeast?
SELECT MAX(year) FROM table_name_11 WHERE region = "southeast"
sql_create_context
CREATE TABLE table_21607058_1 ( wed_3_june VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the time and speed for the rider ranked in 12 on Wed, June 3?
SELECT wed_3_june FROM table_21607058_1 WHERE rank = 12
sql_create_context
CREATE TABLE table_79716 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Gold has a Rank smaller than 5, and a Bronze of 20?
SELECT AVG("Gold") FROM table_79716 WHERE "Rank" < '5' AND "Bronze" = '20'
wikisql
CREATE TABLE table_11019 ( "Year" real, "Award" text, "Category" text, "Work" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest year for the distinguished performance?
SELECT MAX("Year") FROM table_11019 WHERE "Category" = 'distinguished performance'
wikisql
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 * FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '59532862326' AND t_kc22.MED_ORG_DEPT_NM LIKE '%传染科%'
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'bacteremia - gram postive coccus')
eicu
CREATE TABLE table_15051 ( "Film" text, "Director(s)" text, "Producer(s)" text, "Writer(s)" text, "Recipient" text, "Date" text, "Award" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which producer worked for Animus Films LTD?
SELECT "Producer(s)" FROM table_15051 WHERE "Recipient" = 'animus films ltd'
wikisql
CREATE TABLE table_name_27 ( points VARCHAR, entrant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points did the Tyrrell Racing Organisation have?
SELECT points FROM table_name_27 WHERE entrant = "tyrrell racing organisation"
sql_create_context
CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) -- Using valid SQLite, answer the following que...
SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY COUNT(*)
nvbench
CREATE TABLE table_41200 ( "Year" real, "Competition" text, "Club" text, "Nation" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Nation with 2012 as the year, and a Competition of preseason, and a Result of w 0 3?
SELECT "Nation" FROM table_41200 WHERE "Year" = '2012' AND "Competition" = 'preseason' AND "Result" = 'w 0–3'
wikisql
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY SUM(Height)
nvbench
CREATE TABLE table_9033 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on 19/08/2012?
SELECT "Score" FROM table_9033 WHERE "Date" = '19/08/2012'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( r...
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 = 'amino acids 4.25%-dextrose 5%') AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY cost.hadm_id) AS...
mimic_iii
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 71689) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE...
mimic_iii
CREATE TABLE table_13557843_7 ( high_assists VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many high assbeingts with score being l 90 98 (ot)
SELECT COUNT(high_assists) FROM table_13557843_7 WHERE score = "L 90–98 (OT)"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND medication.drugname = 'lorazepam 1 mg tab' AND DATETIME(medic...
eicu
CREATE TABLE table_name_16 ( gdp_per_capita__nominal_ VARCHAR, population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the GDP (nominal) with Population of 5,125,693?
SELECT gdp_per_capita__nominal_ FROM table_name_16 WHERE population = "5,125,693"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT JZJSSJ FROM mzjzjlb WHERE JZLSH = '45655595406'
css
CREATE TABLE table_test_8 ( "id" int, "anemia" bool, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "intravenous_pressors" bool, "fever" bool, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "vasopressors" bool, "renal_disease" bool, "temperatur...
SELECT * FROM table_test_8 WHERE estimated_glomerular_filtration_rate_egfr <= 30 OR serum_creatinine >= 220
criteria2sql
CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) 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 advis...
SELECT dept_name, COUNT(dept_name) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY dept_name ORDER BY COUNT(dept_name) DESC
nvbench
CREATE TABLE table_13454 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the medal total when there is 2 gold medals, and Brazil (BRA) is the nation?
SELECT "Total" FROM table_13454 WHERE "Gold" = '2' AND "Nation" = 'brazil (bra)'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREA...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-136480') AND patient.unitdischargetime IS NULL)...
eicu
CREATE TABLE table_16773 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the report of Mike Hawthorn's winning race?
SELECT "Report" FROM table_16773 WHERE "Winning driver" = 'Mike Hawthorn'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'chr blood loss anemia') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admiss...
mimic_iii
CREATE TABLE table_25776 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who di...
SELECT "High assists" FROM table_25776 WHERE "Team" = 'Portland'
wikisql
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_kc22.HOSP_DOC_CD, t_kc22.HOSP_DOC_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '13618811644'
css
CREATE TABLE table_21110 ( "Rank" real, "Company" text, "Headquarters" text, "Industry" text, "Sales (billion $)" text, "Profits (billion $)" text, "Assets (billion $)" text, "Market Value (billion $)" text ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT "Headquarters" FROM table_21110 WHERE "Sales (billion $)" = '69.2'
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.short_title = "Seroma complicting proc"
mimicsql_data
CREATE TABLE table_64270 ( "Period" text, "Internet Explorer" text, "Chrome" text, "Firefox" text, "Safari" text, "Opera" text, "Other Mozilla" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What internet explorer has 7.89% as the safari, an...
SELECT "Internet Explorer" FROM table_64270 WHERE "Safari" = '7.89%' AND "Chrome" = '8.22%'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'O...
atis
CREATE TABLE table_name_83 ( gold INTEGER, nation VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Gold has a Nation of south korea (kor), and Bronze smaller than 65?
SELECT AVG(gold) FROM table_name_83 WHERE nation = "south korea (kor)" AND bronze < 65
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 num...
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 t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '戚鸿振' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-11-12' AND '2012-08-09'
css
CREATE TABLE table_name_62 ( type VARCHAR, averaging_time VARCHAR, standard VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the type when the averaging time is 1-hour and the standard is 0.12 ppm (235 g/m )?
SELECT type FROM table_name_62 WHERE averaging_time = "1-hour" AND standard = "0.12 ppm (235 μg/m³)"
sql_create_context
CREATE TABLE table_29468 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the outgoing manager of Charler...
SELECT "Outgoing manager" FROM table_29468 WHERE "Team" = 'Charleroi'
wikisql
CREATE TABLE table_43163 ( "Rank" real, "Name" text, "S-League" text, "Singapore Cup" text, "Singapore League Cup" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Rank that when the Singapore Cup is 0 (1), and the...
SELECT SUM("Rank") FROM table_43163 WHERE "Singapore Cup" = '0 (1)' AND "Name" = 'masrezwan masturi'
wikisql
CREATE TABLE table_1300525_1 ( population VARCHAR, pinyin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people live in the district who's capital is h ngf ng xi n?
SELECT population FROM table_1300525_1 WHERE pinyin = "Héngfēng Xiàn"
sql_create_context
CREATE TABLE table_41886 ( "Month, year" text, "Sunk by U-Boat" real, "Sunk by aircraft" real, "Sunk by warship or raider" real, "Sunk by mines" real, "German submarines lost" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total numb...
SELECT COUNT("German submarines lost") FROM table_41886 WHERE "Sunk by mines" > '120958'
wikisql
CREATE TABLE table_22580 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT MIN("Top 10") FROM table_22580
wikisql
CREATE TABLE table_name_23 ( elevated VARCHAR, elector VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Elevated has an Elector of matteo orsini rosso?
SELECT elevated FROM table_name_23 WHERE elector = "matteo orsini rosso"
sql_create_context
CREATE TABLE table_17522 ( "Round" real, "Date" text, "Grand Prix" text, "Circuit" text, "125cc winner" text, "250cc winner" text, "MotoGP winner" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Motogp winnder fo...
SELECT "MotoGP winner" FROM table_17522 WHERE "Circuit" = 'Catalunya'
wikisql
CREATE TABLE table_204_696 ( id number, "issue" number, "volume" number, "title" text, "main feature story" text, "first/early appearance story/stories" text, "release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the name of...
SELECT "title" FROM table_204_696 WHERE "issue" = (SELECT "issue" FROM table_204_696 WHERE "title" = 'iron man') + 1
squall
CREATE TABLE table_14780 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Catalog number for the region of Japan?
SELECT "Catalog" FROM table_14780 WHERE "Region" = 'japan'
wikisql
CREATE TABLE table_52994 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Competition has a Venue of Seoul, and Result of 4-1?
SELECT "Competition" FROM table_52994 WHERE "Venue" = 'seoul' AND "Result" = '4-1'
wikisql
CREATE TABLE table_17908 ( "Year" real, "Delaware" text, "Maryland" text, "New Jersey" text, "New York" text, "Pennsylvania" text, "Washington, D.C." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What teams played in Washington, DC the year...
SELECT "Washington, D.C." FROM table_17908 WHERE "New York" = 'Ramapo LL Ramapo'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1
sede
CREATE TABLE table_57193 ( "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which surface had Yew-Ming Si as a partner?
SELECT "Surface" FROM table_57193 WHERE "Partner" = 'yew-ming si'
wikisql
CREATE TABLE table_name_97 ( city VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What city was in 1889?
SELECT city FROM table_name_97 WHERE year = 1889
sql_create_context
CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255)...
SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY Event_Details
nvbench
CREATE TABLE table_14254 ( "Rank" text, "Province" text, "Population (2011)" real, "Area (km\u00b2)" real, "Density (per km\u00b2)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the least density (per km ) when the rank is 5 and the Area (k...
SELECT MIN("Density (per km\u00b2)") FROM table_14254 WHERE "Rank" = '5' AND "Area (km\u00b2)" < '125,755'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Thyroid Stimulating Hormone"
mimicsql_data
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
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.age < "30" AND diagnoses.long_title = "Pure hyperglyceridemia"
mimicsql_data
CREATE TABLE table_name_28 ( budget VARCHAR, worldwide VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE BUDGET WHEN THE WORLDWIDE BOX OFFICE IS $363,398,565?
SELECT budget FROM table_name_28 WHERE worldwide = "$363,398,565"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON 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.Y...
css
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, ...
SELECT TagName FROM Tags WHERE Tags.TagName LIKE '%c++%'
sede
CREATE TABLE table_17096 ( "Year" text, "Player" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the college for the player who's school is camden high school?
SELECT "College" FROM table_17096 WHERE "School" = 'Camden High School'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "OVERDOSE"
mimicsql_data
CREATE TABLE table_203_803 ( id number, "draw" number, "country" text, "language" text, "artist" text, "song" text, "english translation" text, "place" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which country s...
SELECT "country" FROM table_203_803 ORDER BY "points" DESC LIMIT 1
squall
CREATE TABLE table_62975 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average Top-25, that has an Events that's smaller tha...
SELECT AVG("Top-25") FROM table_62975 WHERE "Events" < '12' AND "Top-5" > '0'
wikisql
CREATE TABLE table_18138132_2 ( function VARCHAR, release_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What functions were released on 2011-06-23?
SELECT function FROM table_18138132_2 WHERE release_date = "2011-06-23"
sql_create_context
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 * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz...
css
CREATE TABLE table_23777640_1 ( other VARCHAR, gn_divisions VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many figures for Other in the district where the GN division is 95?
SELECT COUNT(other) FROM table_23777640_1 WHERE gn_divisions = 95
sql_create_context
CREATE TABLE Sportsinfo ( StuID VARCHAR, major VARCHAR, onscholarship VARCHAR ) CREATE TABLE Student ( StuID VARCHAR, major VARCHAR, onscholarship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show student ids who are on scholarship and hav...
SELECT StuID FROM Student WHERE major = 600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'
sql_create_context
CREATE TABLE table_name_85 ( area__km²_ VARCHAR, capital VARCHAR, population__2005_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many regions have a capital of matanzas and a 2005 population under 670427?
SELECT COUNT(area__km²_) FROM table_name_85 WHERE capital = "matanzas" AND population__2005_ < 670427
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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '44236721' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2819.61) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '44236721' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_k...
css
CREATE TABLE wdmzjzjlb ( 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 wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '25092297' AND hz_info.YLJGDM = '8127400' AND wdmzjzjlb.JZKSMC LIKE '%儿%' UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM ...
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.icd9_code = "5771"
mimicsql_data
CREATE TABLE table_32913 ( "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 is footscray's away team score?
SELECT "Away team score" FROM table_32913 WHERE "Home team" = 'footscray'
wikisql
CREATE TABLE table_22053239_1 ( written_by VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many of the writers had 5.35 viewers?
SELECT COUNT(written_by) FROM table_22053239_1 WHERE us_viewers__millions_ = "5.35"
sql_create_context
CREATE TABLE table_14342480_15 ( extra_points INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of extra points?
SELECT MAX(extra_points) FROM table_14342480_15
sql_create_context
CREATE TABLE orders ( customer_id VARCHAR, order_status VARCHAR ) CREATE TABLE customers ( customer_name VARCHAR, customer_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the name of all the distinct customers who have orders with status 'Pac...
SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Packing"
sql_create_context
CREATE TABLE table_58757 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Height if the weight is kg (lb), the club is Sainte-foy and the pos is cf?...
SELECT "Height" FROM table_58757 WHERE "Weight" = 'kg (lb)' AND "Club" = 'sainte-foy' AND "Pos." = 'cf'
wikisql
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Glucocorticoid deficient" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '金夏彤' AND hz_info.YLJGDM = '4819579' AND NOT mzjzjlb.JZKSMC LIKE '%重症%'
css
CREATE TABLE table_21052 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games ...
SELECT "Drawn" FROM table_21052 WHERE "Lost" = '11' AND "Points for" = '748'
wikisql
CREATE TABLE table_13512105_3 ( fastest_lap VARCHAR, most_laps_led VARCHAR, pole_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who else along with scott dixon and graham rahal drove with the most speed
SELECT fastest_lap FROM table_13512105_3 WHERE most_laps_led = "Scott Dixon" AND pole_position = "Graham Rahal"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, ...
SELECT Id AS "user_link", DisplayName, Reputation, Location FROM Users WHERE (Reputation >= 15000) AND (Reputation <= 75000) ORDER BY Reputation DESC
sede
CREATE TABLE table_62428 ( "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. -- What is the To Par of the player with a t8 Finish?
SELECT "To par" FROM table_62428 WHERE "Finish" = 't8'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT PostId AS "post_link", Text, Score, Comments.CreationDate, Users.DisplayName, Users.Reputation FROM Comments INNER JOIN Users ON Comments.UserId = Users.Id WHERE Text LIKE '%##tstring?bro##%' AND LENGTH(Text) < 20 ORDER BY CreationDate DESC
sede
CREATE TABLE table_name_14 ( place VARCHAR, player VARCHAR, score VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Bunky Henry of the United States scored higher than 68 and his To par was e, what was his place?
SELECT place FROM table_name_14 WHERE score > 68 AND to_par = "e" AND player = "bunky henry"
sql_create_context
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, SUM(Weight) FROM people GROUP BY Sex
nvbench
CREATE TABLE table_name_72 ( prom__m_ INTEGER, peak VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of Prom in M for Peak great knoutberry hill?
SELECT SUM(prom__m_) FROM table_name_72 WHERE peak = "great knoutberry hill"
sql_create_context
CREATE TABLE table_13056 ( "Year" real, "Song" text, "Film" text, "Co-Singer" text, "Composer" text, "Lyricist" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What co-singer has sukhwinder singh as the composer?
SELECT "Co-Singer" FROM table_13056 WHERE "Composer" = 'sukhwinder singh'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 ...
css
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 = "MARRIED" AND lab.itemid = "51093"
mimicsql_data
CREATE TABLE table_name_43 ( mls_cup INTEGER, other VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which MLS Cup has another larger than 9, and a Total smaller than 72?
SELECT AVG(mls_cup) FROM table_name_43 WHERE other > 9 AND total < 72
sql_create_context
CREATE TABLE country ( country_id number, country_name text, capital text, official_native_language text ) CREATE TABLE match_season ( season number, player text, position text, country number, team number, draft_pick_number number, draft_class text, college text ) CREA...
SELECT official_native_language FROM country WHERE official_native_language LIKE "%English%"
spider
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_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '奚修然' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2007-06-07' AND '2020-01-13' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ...
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location, EmailHash FROM Users WHERE Location LIKE '%Karnataka%' ORDER BY Reputation DESC LIMIT 100
sede
CREATE TABLE table_74558 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the highest year for result of 9th
SELECT MAX("Year") FROM table_74558 WHERE "Result" = '9th'
wikisql
CREATE TABLE table_20866 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players went to depaul?
SELECT COUNT("Player") FROM table_20866 WHERE "School/Club Team" = 'DePaul'
wikisql
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_CD, MIN(t_kc24.ILL_PAY / 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 = '9461389' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD
css
CREATE TABLE table_name_25 ( attendance INTEGER, away VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Attendance when Vida is the Away team?
SELECT AVG(attendance) FROM table_name_25 WHERE away = "vida"
sql_create_context
CREATE TABLE party_addresses ( party_id number, address_id number, date_address_from time, address_type_code text, date_address_to time ) CREATE TABLE organization_contact_individuals ( individual_id number, organization_id number, date_contact_from time, date_contact_to time ) CRE...
SELECT COUNT(*) FROM addresses WHERE state_province_county = "Colorado"
spider