instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_30049462_8 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for march 8
SELECT score FROM table_30049462_8 WHERE date = "March 8"
sql_create_context
CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) ...
SELECT Company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T1.Company_ID ORDER BY COUNT(*)
nvbench
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '6557792' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2017-10-25' AND '2021-02-18' GROUP B...
css
CREATE TABLE table_name_39 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 1989, when 1999 is F, and when 1994 is 2R?
SELECT 1989 FROM table_name_39 WHERE 1999 = "f" AND 1994 = "2r"
sql_create_context
CREATE TABLE table_name_54 ( frequency VARCHAR, model_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Frequency for Model Number c7 1.0?
SELECT frequency FROM table_name_54 WHERE model_number = "c7 1.0"
sql_create_context
CREATE TABLE table_60338 ( "Nat." text, "Name" text, "Since" text, "Goals" real, "Ends" real, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of ends when the transfer fee was dkk 14m?
SELECT COUNT("Ends") FROM table_60338 WHERE "Transfer fee" = 'dkk 14m'
wikisql
CREATE TABLE workshop ( workshop_id number, date text, venue text, name text ) CREATE TABLE submission ( submission_id number, scores number, author text, college text ) CREATE TABLE acceptance ( submission_id number, workshop_id number, result text ) -- Using valid SQLit...
SELECT T2.author, T1.result FROM acceptance AS T1 JOIN submission AS T2 ON T1.submission_id = T2.submission_id
spider
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND STRFTIME('%y', prescriptions.startdate) <= '2104'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.discharge_location = "REHAB/DISTINCT PART HOSP"
mimicsql_data
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE equipment_...
SELECT DISTINCT class_of_service.booking_class FROM class_of_service, fare, fare_basis, flight, flight_fare WHERE fare_basis.booking_class = class_of_service.booking_class AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.airline_code = 'TW' AND flight.flight_id = f...
atis
CREATE TABLE table_name_63 ( guns VARCHAR, year VARCHAR, class VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the guns for third-rate ship of the line and rank of vice-admiral with year of 1802
SELECT guns FROM table_name_63 WHERE class = "third-rate ship of the line" AND rank = "vice-admiral" AND year = "1802"
sql_create_context
CREATE TABLE table_203_238 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- uladzimir kazlou participated in two olympic games , but how many other competitions...
SELECT COUNT("competition") FROM table_203_238 WHERE "competition" <> 'olympic games'
squall
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '金正志' AND hz_info.YLJGDM = '8629178' AND NOT zyjzjlb.CYKSMC LIKE '%胃肠%'
css
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Descr...
SELECT c.CreationDate, c.Text, c.Id AS "comment_link", c.PostId AS "post_link" FROM Comments AS c WHERE c.CreationDate > '##yyyy##' + '-' + '##mm##' + '-' + '##dd##' + 'T00:00:00.000' AND Text LIKE '%##SearchOnKeyword1##%' LIMIT 100
sede
CREATE TABLE table_20999 ( "Year" real, "Mens Open" text, "Womens Open" text, "Mixed Open" text, "Mens u20" text, "Womens u20" text, "Senior Mixed" text, "Mens 30" text, "Womens 30" text, "Mens 35" text, "Womens 35" text, "Mens 40" text, "Womens 40" text, "Mens 45...
SELECT "Mens Open" FROM table_20999 WHERE "Mens u20" = 'Qld Country Rustlers def Southern Suns'
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.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '46674930' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-05-21' AND '2000-10-13'
css
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE" AND lab.itemid = "51288"
mimicsql_data
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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 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 CIVIL_SUBSIDY FROM t_kc24 WHERE MED_CLINIC_ID = '18032096351'
css
CREATE TABLE table_name_19 ( first_elected INTEGER, party VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest First Elected, when Party is 'Republican', and when District is 'Minnesota 1'?
SELECT MIN(first_elected) FROM table_name_19 WHERE party = "republican" AND district = "minnesota 1"
sql_create_context
CREATE TABLE table_26336739_1 ( elected VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many elected catagories are there for the district with Saxby Chambliss as the incumbent?
SELECT COUNT(elected) FROM table_26336739_1 WHERE incumbent = "Saxby Chambliss"
sql_create_context
CREATE TABLE table_39929 ( "Date" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Pictorials of mercedes mcnab, girls of hawaiian tropic?
SELECT "Date" FROM table_39929 WHERE "Pictorials" = 'mercedes mcnab, girls of hawaiian tropic'
wikisql
CREATE TABLE table_61875 ( "Colliery" text, "Location" text, "Date" text, "Year" real, "Death toll" real, "cause" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where has a cause of gas explosion, a Death toll larger than 38 on 10 june?
SELECT "Location" FROM table_61875 WHERE "cause" = 'gas explosion' AND "Death toll" > '38' AND "Date" = '10 june'
wikisql
CREATE TABLE table_name_93 ( district VARCHAR, college_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the district where the thanjavur medical college is located?
SELECT district FROM table_name_93 WHERE college_name = "thanjavur medical college"
sql_create_context
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight te...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 24 AND date_day.month_number = 5 AN...
atis
CREATE TABLE table_42663 ( "Rank" real, "Province" text, "Population" real, "Area" real, "Density" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest rank when the population is greater than 59,544 and the area is 1,395.5?
SELECT MIN("Rank") FROM table_42663 WHERE "Population" > '59,544' AND "Area" = '1,395.5'
wikisql
CREATE TABLE table_30321 ( "Year Location" text, "Mens Singles" text, "Womens Singles" text, "Mens Doubles" text, "Womens Doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times did li ju win the womens singles and wang liqin win the ...
SELECT COUNT("Womens Doubles") FROM table_30321 WHERE "Womens Singles" = 'Li Ju' AND "Mens Singles" = 'Wang Liqin'
wikisql
CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
SELECT District, COUNT(District) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY District ORDER BY District
nvbench
CREATE TABLE table_name_58 ( record VARCHAR, week VARCHAR, attenmdance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the team's record after week 7 with 28,161 attending?
SELECT record FROM table_name_58 WHERE week > 7 AND attenmdance = "28,161"
sql_create_context
CREATE TABLE table_23604 ( "Title" text, "Author" text, "Reader" text, "Format" text, "Company" text, "Release Date" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the reader is Syal, Meera Meera Syal, what was the release d...
SELECT "Release Date" FROM table_23604 WHERE "Reader" = 'Syal, Meera Meera Syal'
wikisql
CREATE TABLE table_name_73 ( launch_failures INTEGER, launched VARCHAR, not_usable VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total launch failures when there are 4 launches, and the not usable is greater than 0?
SELECT SUM(launch_failures) FROM table_name_73 WHERE launched = 4 AND not_usable > 0
sql_create_context
CREATE TABLE table_27414 ( "Club" text, "Location" text, "Stadium" text, "Capacity" real, "Manager" text, "Kitmaker" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the stadium in Kuopio?
SELECT "Stadium" FROM table_27414 WHERE "Location" = 'Kuopio'
wikisql
CREATE TABLE table_204_183 ( 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. -- did taiwan receive more or less bronze medals than singapore ?
SELECT (SELECT "bronze" FROM table_204_183 WHERE "nation" = 'taiwan') > (SELECT "bronze" FROM table_204_183 WHERE "nation" = 'singapore')
squall
CREATE TABLE table_55567 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has a Home team score of 13.13 (91)?...
SELECT "Venue" FROM table_55567 WHERE "Home team score" = '13.13 (91)'
wikisql
CREATE TABLE table_14348 ( "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. -- Name the PBA team for paolo mendoza
SELECT "PBA team" FROM table_14348 WHERE "Player" = 'paolo mendoza'
wikisql
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airline ( airline_co...
SELECT COUNT(DISTINCT flight.flight_id) FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'SAN FRANCISCO' AND flight.airline_code = 'UA' AND flight.to_airport = airport_service.airport_code
atis
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 demographic.age, demographic.admission_location FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_62142 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT MIN("Played") FROM table_62142 WHERE "Wins" > '15' AND "Goals against" < '42'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MAIN_COND_DES FROM t_kc21 WHERE MED_CLINIC_ID = '00738240365'
css
CREATE TABLE table_2985664_8 ( strike_rate VARCHAR, catches_stumpings VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every strike rate when cathces/stumpings is 13/1?
SELECT strike_rate FROM table_2985664_8 WHERE catches_stumpings = "13/1"
sql_create_context
CREATE TABLE gyb ( 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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '7500106' AND qtb.MED_ORG_DEPT_NM = '高压氧科' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '7500106' AND gyb.MED_ORG_DEPT_NM = '高压氧科' UNION SELECT zyb.MED_CLINIC_ID FRO...
css
CREATE TABLE table_name_15 ( player VARCHAR, overall VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player was drafted higher than 374 and went to the school Stephen F. Austin?
SELECT player FROM table_name_15 WHERE overall < 374 AND school_club_team = "stephen f. austin"
sql_create_context
CREATE TABLE mzb ( 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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '84027429' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE ...
css
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 prescription...
SELECT (SELECT chartevents.valuenum 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 = 5252) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemi...
mimic_iii
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperfield ( fieldid int, ...
SELECT DISTINCT COUNT(paper.paperid), keyphrase.keyphraseid FROM keyphrase, paper, paperkeyphrase, venue WHERE paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' GROUP BY keyphrase.keyphraseid ...
scholar
CREATE TABLE table_name_38 ( competition VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What competition has 17-1 as the result?
SELECT competition FROM table_name_38 WHERE result = "17-1"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, Creatio...
WITH Raw AS (SELECT SUM(CASE WHEN Votes.VoteTypeId = 2 THEN 5 WHEN Votes.VoteTypeId = 3 THEN -2 ELSE 0 END) + CASE WHEN NOT MIN(Posts.AcceptedAnswerId) IS NULL THEN 2 ELSE 0 END AS Rep, Posts.Id, MIN(Posts.OwnerUserId) AS UserId FROM Posts LEFT JOIN Votes ON Votes.VoteTypeId BETWEEN 2 AND 3 AND Posts.Id = Votes.PostId ...
sede
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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 n...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '91823210' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2008-05-03')
css
CREATE TABLE table_2623498_4 ( Season VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which episodes in season 3 were written by Mark Drop?
SELECT Season AS episode__number FROM table_2623498_4 WHERE written_by = "Mark Drop"
sql_create_context
CREATE TABLE table_name_59 ( result VARCHAR, goal INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the result of a goal larger than 4?
SELECT result FROM table_name_59 WHERE goal > 4
sql_create_context
CREATE TABLE table_73603 ( "Code name" text, "Brand name" text, "Model (list)" text, "Frequency" text, "Cores/Threads" text, "Max Memory Speed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What brand is model G6xxx?
SELECT "Brand name" FROM table_73603 WHERE "Model (list)" = 'G6xxx'
wikisql
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 zyjzjlb.CYBQDM, zyjzjlb.CYBQMC, zyjzjlb.CYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '76532524824'
css
CREATE TABLE table_name_64 ( score VARCHAR, visitor VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On October 25, when the visitor was Colorado, what is the score?
SELECT score FROM table_name_64 WHERE visitor = "colorado" AND date = "october 25"
sql_create_context
CREATE TABLE table_name_47 ( position VARCHAR, player VARCHAR, club_province VARCHAR, caps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does Toby Flood, who is from Newcastle and has fewer than 24 caps, play?
SELECT position FROM table_name_47 WHERE club_province = "newcastle" AND caps < 24 AND player = "toby flood"
sql_create_context
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.JZZDBM, wdmzjzjlb.JZZDSM 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 = '48404711' UNION SELECT bdmzjzjlb.JZZDBM, bdmzjzjlb.JZZDSM FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz...
css
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport ( ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, fare, flight, flight_fare, flight_stop WHERE ((CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'DE...
atis
CREATE TABLE table_1107 ( "Season" text, "Champions (Premier League titles)" text, "Runners-up" text, "Third place" text, "Player(s) (Club)" text, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the team scored 17 and Slavija placed ...
SELECT "Season" FROM table_1107 WHERE "Goals" = '17' AND "Runners-up" = 'Slavija'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT t_kc21.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_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 = '7336183' GROUP BY t_kc21.MED_ORG_DEPT_CD
css
CREATE TABLE table_19787093_1 ( till_aligarh INTEGER, vehicle_category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the vehicle category is multi-axle vehicle, what is the till aligarh?
SELECT MIN(till_aligarh) FROM table_19787093_1 WHERE vehicle_category = "Multi-axle Vehicle"
sql_create_context
CREATE TABLE table_203_168 ( id number, "team name" text, "leagues" text, "base" text, "year started" text, "year ended" text, "notable riders" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what team started in 1949 and ended in 1973 ?
SELECT "team name" FROM table_203_168 WHERE "year started" = 1949 AND "year ended" = 1973
squall
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerU...
SELECT SUM(LENGTH(Body)) / SUM(Score) * 1.0 AS CharsPerUpvote FROM Posts WHERE OwnerUserId = '##UserId##' AND PostTypeId = 2 GROUP BY OwnerUserId
sede
CREATE TABLE table_20867295_2 ( top_scorer VARCHAR, winner VARCHAR, third_place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When nac breda came in third place and psv eindhoven was the winner who is the top scorer?
SELECT top_scorer FROM table_20867295_2 WHERE winner = "PSV Eindhoven" AND third_place = "NAC Breda"
sql_create_context
CREATE TABLE table_204_523 ( id number, "week" number, "date" text, "opponent" text, "score" text, "result" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference between the number of g...
SELECT ABS((SELECT COUNT(*) FROM table_204_523 WHERE "result" = 'win') - (SELECT COUNT(*) FROM table_204_523 WHERE "result" = 'loss'))
squall
CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) 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 classroom ( building varchar(15), ...
SELECT year, COUNT(*) FROM section ORDER BY year
nvbench
CREATE TABLE table_203_368 ( id number, "date" text, "opponent" text, "venue" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in how many games did cardiff city f.c. score at least 3 goals ?
SELECT COUNT(*) FROM table_203_368 WHERE "result" >= 3
squall
CREATE TABLE table_name_49 ( laps INTEGER, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average lap of the race with a 23 finish?
SELECT AVG(laps) FROM table_name_49 WHERE finish = "23"
sql_create_context
CREATE TABLE player_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first text ) CREATE TABLE hall_of_fame ( player_id text, yearid number, votedby text, ballots text, needed text, votes text, i...
SELECT DISTINCT notes FROM player_award WHERE player_id = "willite01"
thehistoryofbaseball
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturd...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 21 AND date_day.month_number = 2 AND da...
atis
CREATE TABLE table_train_52 ( "id" int, "pregnancy_or_lactation" bool, "consent" bool, "surgery" bool, "hemodynamic_instability" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- patients under 18 years
SELECT * FROM table_train_52 WHERE age < 18
criteria2sql
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.formulary_drug_cd = "SIMV40"
mimicsql_data
CREATE TABLE table_204_740 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long did it take fer...
SELECT "time/retired" FROM table_204_740 WHERE "driver" = 'fernando alonso'
squall
CREATE TABLE table_name_69 ( score VARCHAR, outcome VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Outcome is Winner, and when Opponent is Angela Haynes?
SELECT score FROM table_name_69 WHERE outcome = "winner" AND opponent = "angela haynes"
sql_create_context
CREATE TABLE table_25956 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many scores had a date of March 6?
SELECT COUNT("Score") FROM table_25956 WHERE "Date" = 'March 6'
wikisql
CREATE TABLE pilot ( Pilot_Id int(11), Name varchar(50), Age int(11) ) CREATE TABLE match ( Round real, Location text, Country text, Date text, Fastest_Qualifying text, Winning_Pilot text, Winning_Aircraft text ) CREATE TABLE airport ( Airport_ID int, Airport_Name text,...
SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description ORDER BY COUNT(Description)
nvbench
CREATE TABLE table_39690 ( "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 gold for the nation with a record of bronze 1, Syria nation with a grand total l...
SELECT AVG("Gold") FROM table_39690 WHERE "Bronze" = '1' AND "Nation" = 'syria' AND "Total" < '1'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1...
SELECT Sex, COUNT(*) FROM Faculty GROUP BY Sex ORDER BY Sex
nvbench
CREATE TABLE customers ( customer_details VARCHAR, customer_id VARCHAR ) CREATE TABLE policies ( customer_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of the customer that has been involved in the most policies.
SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_8979 ( "Official Name" text, "Status" text, "Area km 2" real, "Population" real, "Census Ranking" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the population of durham parish?
SELECT COUNT("Population") FROM table_8979 WHERE "Official Name" = 'durham'
wikisql
CREATE TABLE table_42123 ( "City" text, "State" text, "AAM Accredited" text, "AAM Member" text, "ASTC Member" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is State, when AAM Accredited is No, when ASTC Member is No, and when City is Tulsa?
SELECT "State" FROM table_42123 WHERE "AAM Accredited" = 'no' AND "ASTC Member" = 'no' AND "City" = 'tulsa'
wikisql
CREATE TABLE table_42455 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Rank" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team is ranked 3rd in 2008?
SELECT "Team" FROM table_42455 WHERE "Rank" = '3rd' AND "Year" = '2008'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
nvbench
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx of bladder malignancy') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31141) AND STRFTIME('%y', di...
mimic_iii
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND diagnoses.short_title = "Injury-hanging"
mimicsql_data
CREATE TABLE table_77882 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day d...
SELECT "Date" FROM table_77882 WHERE "Winning driver" = 'emerson fittipaldi' AND "Race" = 'spanish grand prix'
wikisql
CREATE TABLE table_5661 ( "Surname" text, "First" text, "D.O.B." text, "Bats" text, "Throws" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which First has a Position of c, and Bats of l?
SELECT "First" FROM table_5661 WHERE "Position" = 'c' AND "Bats" = 'l'
wikisql
CREATE TABLE table_78551 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Hawthorn's score as the home team?
SELECT "Home team score" FROM table_78551 WHERE "Home team" = 'hawthorn'
wikisql
CREATE TABLE table_31161 ( "No." real, "#" real, "Episode title" text, "Director" text, "Writer(s)" text, "U.S. original airdate" text, "Prod. code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 22 is the number what is the episode tit...
SELECT "Episode title" FROM table_31161 WHERE "No." = '22'
wikisql
CREATE TABLE table_30892 ( "Number" text, "Serial Number" real, "Into Service" text, "Withdrawn" text, "Scrapped" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most serial number for feb 1994
SELECT MAX("Serial Number") FROM table_30892 WHERE "Scrapped" = 'Feb 1994'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Biopsy of tonsils and adenoids"
mimicsql_data
CREATE TABLE genre ( gid int, genre text ) CREATE TABLE directed_by ( id int, msid int, did int ) CREATE TABLE written_by ( id int, msid int, wid int ) CREATE TABLE cast ( id int, msid int, aid int, role text ) CREATE TABLE company ( id int, name text, cou...
SELECT movie.title FROM company, copyright, movie WHERE company.name = 'company_name0' AND copyright.cid = company.id AND movie.mid = copyright.msid AND movie.release_year > 2010
imdb
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ch dvt/embl prox low ext') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2104' GROUP BY STRFTIME('%y...
mimic_iii
CREATE TABLE table_name_83 ( championship_titles VARCHAR, fastest_laps VARCHAR, podiums VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many titles for the nation with less than 3 fastest laps and 22 podiums?
SELECT championship_titles FROM table_name_83 WHERE fastest_laps < 3 AND podiums = 22
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
nvbench
CREATE TABLE table_24604 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Final Score" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total number of weeks where the game played Iv...
SELECT COUNT("Week") FROM table_24604 WHERE "Location" = 'Ivor Wynne Stadium'
wikisql
CREATE TABLE table_53102 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date ...
SELECT "Date" FROM table_53102 WHERE "Winning driver" = 'rodger ward'
wikisql
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY AVG(basePrice)
nvbench
CREATE TABLE table_name_64 ( nickname VARCHAR, gender VARCHAR, weight_at_birth VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nickname of the boy who weighed 810g (26.0 oz.) at birth?
SELECT nickname FROM table_name_64 WHERE gender = "boy" AND weight_at_birth = "810g (26.0 oz.)"
sql_create_context
CREATE TABLE table_204_334 ( id number, "opposition" text, "matches" number, "won" number, "drawn" number, "lost" number, "for" number, "against" number, "win%" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the only team to ...
SELECT "opposition" FROM table_204_334 WHERE "drawn" > 0
squall
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 IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '54503411' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 5443.41)
css