instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_26996293_3 ( cfl_team VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many CFL teams drafted someone from mount allison college?
SELECT COUNT(cfl_team) FROM table_26996293_3 WHERE college = "Mount Allison"
sql_create_context
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2122.0" AND prescriptions.formulary_drug_cd = "BETH5"
mimicsql_data
CREATE TABLE table_65419 ( "Branding" text, "Call-Sign" text, "Frequency" text, "Power (kw)" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the location when the branding is 1116 DXAS Zamboanga?
SELECT "Location" FROM table_65419 WHERE "Branding" = '1116 dxas zamboanga'
wikisql
CREATE TABLE table_name_33 ( points INTEGER, extra_points VARCHAR, field_goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had a points average with 0 extra points and 0 field goals?
SELECT AVG(points) FROM table_name_33 WHERE extra_points = 0 AND field_goals > 0
sql_create_context
CREATE TABLE table_name_79 ( share_of_seats VARCHAR, european_election__uk_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Share of seats has a European election (UK) of 2009?
SELECT share_of_seats FROM table_name_79 WHERE european_election__uk_ = 2009
sql_create_context
CREATE TABLE table_name_7 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date held the match at the City Stadium, Georgetown?
SELECT date FROM table_name_7 WHERE venue = "city stadium, georgetown"
sql_create_context
CREATE TABLE table_72197 ( "Target" text, "Target Code (Allied)" text, "Luftwaffe unit (wing)" text, "Allied forces" text, "Effect on Allied Squadrons (according to official figures)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Allied Force...
SELECT "Allied forces" FROM table_72197 WHERE "Target" = 'Woensdrecht'
wikisql
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE Apartment_Bookin...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2
nvbench
CREATE TABLE table_name_24 ( team VARCHAR, laps VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team had 10 Labs and the Driver was Alex Yoong?
SELECT team FROM table_name_24 WHERE laps = 10 AND driver = "alex yoong"
sql_create_context
CREATE TABLE table_35500 ( "Date" text, "Home Team" text, "Score" text, "Away Team" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score at Spartan Stadium when San Jose was the Home team?
SELECT "Score" FROM table_35500 WHERE "Home Team" = 'san jose' AND "Venue" = 'spartan stadium'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number...
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 = 21454)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE table_48673 ( "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. -- what i...
SELECT "Score" FROM table_48673 WHERE "Date" = 'march 8'
wikisql
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 jyjgzbb.JCFF FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH...
css
CREATE TABLE table_64785 ( "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 is the sum of the bronze medals when there were less than 8 total medals, 0 silver meda...
SELECT SUM("Bronze") FROM table_64785 WHERE "Total" < '8' AND "Rank" = '9' AND "Silver" < '0'
wikisql
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst t...
SELECT T1.country FROM sampledata15 AS T1 JOIN resultsdata15 AS T2 ON T1.sample_pk = T2.sample_pk WHERE T2.concen = "0" GROUP BY T1.country
pesticide
CREATE TABLE table_name_23 ( silver VARCHAR, gold VARCHAR, bronze VARCHAR, total VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times is the total less than 15, rank less than 5, bronze is 4 and gold smaller than 3?
SELECT COUNT(silver) FROM table_name_23 WHERE total < 15 AND rank < 5 AND bronze = 4 AND gold < 3
sql_create_context
CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE...
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details
nvbench
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 COUNT(*) FROM (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '4616814' GROUP BY MED_ORG_DEPT_CD HAVING AVG(IN_HOSP_DAYS) > 24) AS T
css
CREATE TABLE ref_colors ( color_code text, color_description text ) CREATE TABLE products ( product_id number, color_code text, product_category_code text, product_name text, typical_buying_price text, typical_selling_price text, product_description text, other_product_details t...
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame"
spider
CREATE TABLE table_name_59 ( semi_finalist__number2 VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Semi-Finalist #2 in 2007?
SELECT semi_finalist__number2 FROM table_name_59 WHERE year = "2007"
sql_create_context
CREATE TABLE table_30288 ( "Religion" text, "Births" real, "Conversions" text, "New adherents per year" real, "Growth rate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of new adherents per year for confucianism
SELECT COUNT("New adherents per year") FROM table_30288 WHERE "Religion" = 'Confucianism'
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 AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay = "27"
mimicsql_data
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '78396126' AND t_kc22.STA_DATE BETWEEN '2009-11-30' AND '2016-06-13' AND t_kc22.SELF_PAY_PRO < 0.31
css
CREATE TABLE table_name_48 ( rank VARCHAR, studio VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of ranks that had vestron as the studio?
SELECT COUNT(rank) FROM table_name_48 WHERE studio = "vestron"
sql_create_context
CREATE TABLE table_14650162_1 ( pick__number VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many picks played Tight end?
SELECT COUNT(pick__number) FROM table_14650162_1 WHERE position = "Tight End"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antiarrhythmics - class iii antiarrhythmic' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME()...
eicu
CREATE TABLE table_36704 ( "Conference" text, "Division" text, "Team" text, "City" text, "Home Stadium" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Division does the City being jacksonville, florida belong to?
SELECT "Division" FROM table_36704 WHERE "City" = 'jacksonville, florida'
wikisql
CREATE TABLE table_29565541_2 ( stolen_ends INTEGER, l VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 5 is the l what is the lowest amount of stolen ends?
SELECT MIN(stolen_ends) FROM table_29565541_2 WHERE l = 5
sql_create_context
CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id int, interaction_type text ) CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, OMIM int, Porphyria text ) CREATE TABLE medicine ( id int, name text, Trade_Name...
SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id
nvbench
CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE ...
SELECT year, SUM(citation_num) FROM publication WHERE title = 'Making database systems usable' GROUP BY year
academic
CREATE TABLE table_name_41 ( world_record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the 123kg of the Total world record?
SELECT 123 AS kg FROM table_name_41 WHERE world_record = "total"
sql_create_context
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ...
css
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 = '30728995' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2002-08-27')
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "74463"
mimicsql_data
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(DISTINCT IN_DIAG_DIS_CD) FROM t_kc21 WHERE PERSON_ID = '96886355' AND IN_HOSP_DATE BETWEEN '2002-11-30' AND '2010-06-08'
css
CREATE TABLE table_name_38 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game that was played on february 27, 2000?
SELECT result FROM table_name_38 WHERE date = "february 27, 2000"
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '56819536' AND t_kc22.STA_DATE BETWEEN '2006-11-26' AND '2021-01-02' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_41820 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the visitor when the record is 2-1?
SELECT "Visitor" FROM table_41820 WHERE "Record" = '2-1'
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Ciprofloxacin"
mimicsql_data
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean...
SELECT a.Id AS "Answer ID", p.Id AS "Question ID", p.Title AS "Title" FROM Posts AS p JOIN Posts AS a ON p.Id = a.ParentId WHERE p.PostTypeId = 1 AND a.OwnerUserId = '##UserId:int##' AND a.Score >= '##MinAnswerScore:int##' AND a.Id != p.AcceptedAnswerId
sede
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) -- Using valid SQLite, answer the following questions ...
SELECT Country, COUNT(*) FROM climber GROUP BY Country ORDER BY COUNT(*)
nvbench
CREATE TABLE table_7216 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of points where there w...
SELECT SUM("Points") FROM table_7216 WHERE "Lost" = '3' AND "Played" > '12'
wikisql
CREATE TABLE table_name_36 ( damage__millions_usd__ VARCHAR, min_press___mbar__ VARCHAR, deaths VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the cost of 972 Min Press caused 52 death?
SELECT damage__millions_usd__ FROM table_name_36 WHERE min_press___mbar__ = "972" AND deaths = "52"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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...
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0923184' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM
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 demographic.marital_status, demographic.admission_type FROM demographic WHERE demographic.subject_id = "15898"
mimicsql_data
CREATE TABLE table_5682 ( "Gauge" text, "Railway" text, "Class" text, "Works no." text, "Year" text, "Builder" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which railway has a class of 250 and year 1936?
SELECT "Railway" FROM table_5682 WHERE "Class" = '250' AND "Year" = '1936'
wikisql
CREATE TABLE table_25800134_2 ( writer_s_ VARCHAR, season__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are all the writers of episodes in season 24?
SELECT writer_s_ FROM table_25800134_2 WHERE season__number = 24
sql_create_context
CREATE TABLE table_26473176_1 ( series VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many 'series' were in the 12th 'position?
SELECT COUNT(series) FROM table_26473176_1 WHERE position = "12th"
sql_create_context
CREATE TABLE table_26591434_1 ( ratings__kansai_ VARCHAR, original_airdate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ratings for the original air date may 25, 2010 22.00 - 22.54?
SELECT ratings__kansai_ FROM table_26591434_1 WHERE original_airdate = "May 25, 2010 22.00 - 22.54"
sql_create_context
CREATE TABLE table_29135051_3 ( guest_s_ VARCHAR, ratings VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who guest starred on the episode with a 1.44m rating
SELECT guest_s_ FROM table_29135051_3 WHERE ratings = "1.44m"
sql_create_context
CREATE TABLE table_11545282_7 ( years_for_jazz VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years did Paul Griffin play for the Jazz?
SELECT COUNT(years_for_jazz) FROM table_11545282_7 WHERE player = "Paul Griffin"
sql_create_context
CREATE TABLE table_name_4 ( genre VARCHAR, type VARCHAR, developer_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of 3D game did Valve Corporation release?
SELECT genre FROM table_name_4 WHERE type = "3d" AND developer_s_ = "valve corporation"
sql_create_context
CREATE TABLE table_16799784_8 ( year_named INTEGER, latitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year was the feature at a 33.3S latitude named?
SELECT MAX(year_named) FROM table_16799784_8 WHERE latitude = "33.3S"
sql_create_context
CREATE TABLE table_204_443 ( id number, "week" number, "date" text, "opponent" text, "result" text, "game site" text, "attendance" number, "bye" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- total number of attendees at the two games ag...
SELECT SUM("attendance") FROM table_204_443 WHERE "opponent" = 'new england patriots'
squall
CREATE TABLE table_name_62 ( type VARCHAR, position VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the type when the position is ambassador and the location is rabat?
SELECT type FROM table_name_62 WHERE position = "ambassador" AND location = "rabat"
sql_create_context
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "4260"
mimicsql_data
CREATE TABLE table_name_16 ( country VARCHAR, olympics VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country in the 2008 summer olympics is vadim devyatovskiy from?
SELECT country FROM table_name_16 WHERE olympics = "2008 summer olympics" AND name = "vadim devyatovskiy"
sql_create_context
CREATE TABLE table_204_100 ( id number, "date" text, "name of ship" text, "nationality" text, "tonnage" number, "fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference in tonnage between the heaviest and the lightest ships ?...
SELECT MAX("tonnage") - MIN("tonnage") FROM table_204_100
squall
CREATE TABLE table_name_43 ( opponents VARCHAR, partner VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the opponents for mashona washington november 21, 2009
SELECT opponents FROM table_name_43 WHERE partner = "mashona washington" AND date = "november 21, 2009"
sql_create_context
CREATE TABLE table_name_28 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the away team when the home team is sydney spirit?
SELECT away_team FROM table_name_28 WHERE home_team = "sydney spirit"
sql_create_context
CREATE TABLE table_66474 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What power has A as the class, and 93.7 as the frequency?
SELECT "Power" FROM table_66474 WHERE "Class" = 'a' AND "Frequency" = '93.7'
wikisql
CREATE TABLE table_name_13 ( australian_marquee VARCHAR, captain VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Australian Marquee team is Michael Beauchamp a captain of?
SELECT australian_marquee FROM table_name_13 WHERE captain = "michael beauchamp"
sql_create_context
CREATE TABLE table_1480455_1 ( population__2005_ VARCHAR, population_density___km_2__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of population in the year 2005 where the population density 35.9 (/km 2)?
SELECT COUNT(population__2005_) FROM table_1480455_1 WHERE population_density___km_2__ = "35.9"
sql_create_context
CREATE TABLE table_204_576 ( id number, "year" number, "best" text, "location" text, "date" text, "world rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which location has the best time other than brussels ?
SELECT "location" FROM table_204_576 WHERE "location" <> 'brussels' ORDER BY "best" LIMIT 1
squall
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 prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "NALO4I"
mimicsql_data
CREATE TABLE table_31057 ( "Episode" real, "Airdate" text, "Iron Chef" text, "Challenger" text, "Theme Ingredient" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did the episode air when guy grossi won?
SELECT "Airdate" FROM table_31057 WHERE "Winner" = 'Guy Grossi'
wikisql
CREATE TABLE table_28262 ( "AB - Angry boar" text, "B - Bishop" text, "BA - Running Bear" text, "BB - Blind Bear" text, "BC - Beast Cadet" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is b - bishop where ab - angry boar is vw - vertical wolf?...
SELECT "B - Bishop" FROM table_28262 WHERE "AB - Angry boar" = 'VW - Vertical Wolf'
wikisql
CREATE TABLE culture_company ( company_name text, type text, incorporated_in text, group_equity_shareholding number, book_club_id text, movie_id text ) CREATE TABLE movie ( movie_id number, title text, year number, director text, budget_million number, gross_worldwide nu...
SELECT COUNT(DISTINCT director) FROM movie
spider
CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End...
SELECT Payment_Method_Code, COUNT(Payment_Method_Code) FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(Payment_Method_Code) DESC
nvbench
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE...
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE table_1997759_1 ( location VARCHAR, last_flew VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- at what location is the last flew on 11 june 2000
SELECT location FROM table_1997759_1 WHERE last_flew = "11 June 2000"
sql_create_context
CREATE TABLE table_189598_7 ( population_density__per_km²_ VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When buffalo narrows is the name how many measurements of population density per kilometer squared are there?
SELECT COUNT(population_density__per_km²_) FROM table_189598_7 WHERE name = "Buffalo Narrows"
sql_create_context
CREATE TABLE table_25375093_1 ( season VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the season for position 4th
SELECT COUNT(season) FROM table_25375093_1 WHERE position = "4th"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2122.0" AND lab.label = "Prot. Electrophoresis, Urine"
mimicsql_data
CREATE TABLE table_name_37 ( score VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the game with 1,125 people in attendance?
SELECT score FROM table_name_37 WHERE attendance = "1,125"
sql_create_context
CREATE TABLE table_name_69 ( nominee_s_ VARCHAR, year VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which nominees won before year 2005?
SELECT nominee_s_ FROM table_name_69 WHERE year < 2005 AND result = "won"
sql_create_context
CREATE TABLE table_name_18 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent, when Date is 8 April 1999?
SELECT opponent FROM table_name_18 WHERE date = "8 april 1999"
sql_create_context
CREATE TABLE table_name_44 ( player VARCHAR, to_par VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player from Spain that has a +2 to par?
SELECT player FROM table_name_44 WHERE to_par = "+2" AND country = "spain"
sql_create_context
CREATE TABLE table_65764 ( "Ship name" text, "Year built" real, "Length" text, "Crew" real, "Guests" real, "Staterooms" real, "Comments" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total for guests with a ship name of rv indoc...
SELECT COUNT("Guests") FROM table_65764 WHERE "Ship name" = 'rv indochina' AND "Crew" < '28'
wikisql
CREATE TABLE table_name_60 ( venue VARCHAR, runs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During runs 332, what was the venue?
SELECT venue FROM table_name_60 WHERE runs = "332"
sql_create_context
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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 tex...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i...
mimic_iii
CREATE TABLE table_name_17 ( zone_2008 VARCHAR, services VARCHAR, station VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Zone 2008 has Services of greater anglia, and a Station of cheshunt?
SELECT zone_2008 FROM table_name_17 WHERE services = "greater anglia" AND station = "cheshunt"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.dob_year > "2097"
mimicsql_data
CREATE TABLE qtb ( CLINIC_ID 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, INSU_TYPE text, IN...
SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_NM = '郑阳荣' AND qtb.IN_HOSP_DATE BETWEEN '2009-09-03' AND '2010-03-27' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_NM = '郑阳荣' AND gyb.IN_HOSP_DATE BETWEEN '2009-09-03' AND '2010-03-27' GROUP BY gy...
css
CREATE TABLE table_40166 ( "School" text, "Location" text, "Enrolment" real, "Founded" real, "Denomination" text, "Boys/Girls" text, "Day/Boarding" text, "Year Entered Competition" real, "School Colors" text ) -- Using valid SQLite, answer the following questions for the tables pro...
SELECT "School" FROM table_40166 WHERE "Boys/Girls" = 'boys' AND "Year Entered Competition" = '1929' AND "School Colors" = 'royal blue and gold'
wikisql
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, MIN(Weight) FROM people GROUP BY Sex ORDER BY Sex
nvbench
CREATE TABLE table_name_14 ( theme VARCHAR, year VARCHAR, issue_price VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What theme is associated with a year before 2006 and Issue Price of $25.22?
SELECT theme FROM table_name_14 WHERE year < 2006 AND issue_price = "$25.22"
sql_create_context
CREATE TABLE table_79078 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Venue, when Status is 'Test Match', and when Against is '12'?
SELECT "Venue" FROM table_79078 WHERE "Status" = 'test match' AND "Against" = '12'
wikisql
CREATE TABLE table_328 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player attended Loyola Marymount?
SELECT "Player" FROM table_328 WHERE "School/Club Team/Country" = 'Loyola Marymount'
wikisql
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT SUM(t_kc22.QTY), SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '2815' AND t_kc22.STA_DATE BETWEEN '2008-08-15' AND '2019-06-21'
css
CREATE TABLE table_43253 ( "Tournament" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following qu...
SELECT "2002" FROM table_43253 WHERE "2008" = 'career statistics'
wikisql
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_kc21.FLX_MED_ORG_ID FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '65701713769'
css
CREATE TABLE table_35312 ( "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. -- What i...
SELECT "Location Attendance" FROM table_35312 WHERE "Date" = 'february 27'
wikisql
CREATE TABLE table_name_23 ( rating VARCHAR, viewers__households_in_millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the rating of the season that had 18.17 million household viewers?
SELECT rating FROM table_name_23 WHERE viewers__households_in_millions_ = "18.17"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperio...
SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-56583') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_22871239_5 ( high_rebounds VARCHAR, _number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many high rebound catagories are listed for game number 5?
SELECT COUNT(high_rebounds) FROM table_22871239_5 WHERE _number = 5
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT TotalUpVotes = SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END), TotalDownVotes = SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END), Accepts = SUM(CASE WHEN VoteTypeId = 1 THEN 1 ELSE 0 END) FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId WHERE p.OwnerUserId = '##UserId##'
sede
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 '2003-03-14' AND '2017-06-09' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_42284 ( "Tournament" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using val...
SELECT "2011" FROM table_42284 WHERE "2005" = '2r' AND "2003" = '2r'
wikisql