instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_61 ( goal_difference VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Goal Difference for Postion 22?
SELECT goal_difference FROM table_name_61 WHERE position = 22
sql_create_context
CREATE TABLE table_name_39 ( language VARCHAR, original_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the language of the film originally titled ?
SELECT language FROM table_name_39 WHERE original_name = "רגעים"
sql_create_context
CREATE TABLE table_57546 ( "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 is the height in feet of player number 24?
SELECT "Height in Ft." FROM table_57546 WHERE "No.(s)" = '24'
wikisql
CREATE TABLE table_52614 ( "Block A" text, "Akira" text, "Atsushi Aoki" text, "Black Tiger V" text, "Jado" text, "Milano Collection A.T." text, "Prince Devitt" text, "Tiger Mask IV" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ...
SELECT "Block A" FROM table_52614 WHERE "Prince Devitt" = 'devitt (9:53)'
wikisql
CREATE TABLE table_43815 ( "Club" text, "League goals" text, "FA Cup goals" text, "League Cup goals" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Total has an FA Cup goals of 1, and a League goals of 4 + 7?
SELECT AVG("Total") FROM table_43815 WHERE "FA Cup goals" = '1' AND "League goals" = '4 + 7'
wikisql
CREATE TABLE table_name_6 ( high_assists VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high assists when the record was 33 15?
SELECT high_assists FROM table_name_6 WHERE record = "33–15"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_i...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE Maintenance_Contracts ( maintenance_contract_id INTEGER, maintenance_contract_company_id INTEGER, contract_start_date DATETIME, contract_end_date DATETIME, other_contract_details VARCHAR(255) ) CREATE TABLE Maintenance_Engineers ( engineer_id INTEGER, company_id INTEGER, fi...
SELECT last_name, COUNT(last_name) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY last_name ORDER BY COUNT(last_name) DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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...
css
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), a...
SELECT apt_number, room_count FROM Apartments
nvbench
CREATE TABLE table_55806 ( "Position" real, "Club" text, "Played" real, "Points" text, "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("Goal Difference") FROM table_55806 WHERE "Club" = 'ud alzira' AND "Played" > '38'
wikisql
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.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE table_name_36 ( city___town VARCHAR, icao VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which city is the ICAO gvma?
SELECT city___town FROM table_name_36 WHERE icao = "gvma"
sql_create_context
CREATE TABLE table_49202 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" real, "Avg. Finish" real, "Winnings" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Befo...
SELECT AVG("Starts") FROM table_49202 WHERE "Poles" = '0' AND "Position" = '65th' AND "Year" < '2007'
wikisql
CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int...
SELECT Left_office, COUNT(Left_office) FROM party GROUP BY Minister
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 AVG(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_AGE < 10)
css
CREATE TABLE table_5654 ( "Pick #" real, "MLS Team" text, "Player" text, "Position" text, "Affiliation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position did the drafted player affiliated with UCLA play?
SELECT "Position" FROM table_5654 WHERE "Affiliation" = 'ucla'
wikisql
CREATE TABLE table_name_11 ( team VARCHAR, points VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has 48 points in the class of 500 cc?
SELECT team FROM table_name_11 WHERE points = 48 AND class = "500 cc"
sql_create_context
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR...
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building
nvbench
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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE table_28561455_1 ( no_in_series VARCHAR, us_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For how many series were there 11.84 million watchers?
SELECT no_in_series FROM table_28561455_1 WHERE us_viewers__million_ = "11.84"
sql_create_context
CREATE TABLE table_47997 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round has a Position of lb, and a Pick smaller than 25?
SELECT COUNT("Round") FROM table_47997 WHERE "Position" = 'lb' AND "Pick" < '25'
wikisql
CREATE TABLE table_name_50 ( location_attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the location of the game on February 2?
SELECT location_attendance FROM table_name_50 WHERE date = "february 2"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-3784') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE fgwyjzb ( 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 gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '51816664' AND t_kc22.STA_DATE BETWEEN '2011-09-07' AND '2018-07-17' AND gwyjzb.MED_SER_ORG_NO = '6788679' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CL...
css
CREATE TABLE table_204_14 ( id number, "rank" number, "bib" number, "athlete" text, "country" text, "time" text, "deficit" text, "note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times is the united states in the rankings ?
SELECT COUNT(*) FROM table_204_14 WHERE "country" = 'united states'
squall
CREATE TABLE table_name_49 ( nationality VARCHAR, cardinalatial_order_and_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of the elector withe the Cardinalatial order and title of Cardinal-Priest of Ss. XII Apostoli?
SELECT nationality FROM table_name_49 WHERE cardinalatial_order_and_title = "cardinal-priest of ss. xii apostoli"
sql_create_context
CREATE TABLE table_21820 ( "SECR No." real, "SR No." real, "BR No." real, "Builder" text, "Date Delivered" text, "Date Withdrawn" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the builder for br no. 31779?
SELECT "Builder" FROM table_21820 WHERE "BR No." = '31779'
wikisql
CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname JOIN player AS T3 ON T2.pid = T3.pid WHERE T3.pname = 'Charles'
spider
CREATE TABLE Product_Suppliers ( product_id INTEGER, supplier_id INTEGER, date_supplied_from DATETIME, date_supplied_to DATETIME, total_amount_purchased VARCHAR(80), total_value_purchased DECIMAL(19,4) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date...
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code
nvbench
CREATE TABLE table_13942 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time for South Korea?
SELECT "Time" FROM table_13942 WHERE "Country" = 'south korea'
wikisql
CREATE TABLE table_name_14 ( year INTEGER, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average year of the montreal expos?
SELECT AVG(year) FROM table_name_14 WHERE team = "montreal expos"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id num...
SELECT Posts.Id, MIN(Tags.TagName), Posts.Score FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id GROUP BY Posts.Id, Posts.ViewCount, Posts.Score ORDER BY Posts.ViewCount DESC LIMIT 100
sede
CREATE TABLE table_name_1 ( directed_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the show with the production code k2708?
SELECT directed_by FROM table_name_1 WHERE production_code = "k2708"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code tex...
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 = 14671)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
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 SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE table_47492 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the 2013 Eaff East Asian Cup Qualifier played?
SELECT "Venue" FROM table_47492 WHERE "Competition" = '2013 eaff east asian cup qualifier'
wikisql
CREATE TABLE teachers ( lastname text, firstname text, classroom number ) CREATE TABLE list ( lastname text, firstname text, grade number, classroom number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show me the classrooms grade 5 is using.
SELECT DISTINCT classroom FROM list WHERE grade = 5
spider
CREATE TABLE table_57001 ( "Episode #" text, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which is the episode # of the episode titled 'The Man Behind the Curtain'?
SELECT "Episode #" FROM table_57001 WHERE "Title" = 'the man behind the curtain'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Voting_record ( StuID INTEGER, Registration_Date VARCHAR(12), Election_Cycle VARCHAR(12), Presiden...
SELECT Registration_Date, COUNT(Registration_Date) FROM Voting_record ORDER BY COUNT(Registration_Date)
nvbench
CREATE TABLE table_66369 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" real, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real ) -- Using valid SQLite, answer the following questi...
SELECT SUM("FA Cup Goals") FROM table_66369 WHERE "Total Apps" = '10 (4)'
wikisql
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 * FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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 WHERE demographic.gender = "F" AND demographic.diagnosis = "BOWEL OBSTRUCTION"
mimicsql_data
CREATE TABLE table_26108103_2 ( rushing_yards VARCHAR, opponent VARCHAR, passing_yards VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rushing yards where there when the opponent was Indiana and there was 503 passing yards?
SELECT rushing_yards FROM table_26108103_2 WHERE opponent = "Indiana" AND passing_yards = 503
sql_create_context
CREATE TABLE table_68315 ( "Language" text, "Number" text, "percentage (%)" text, "males" text, "females" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Males have a percentage of 0.42?
SELECT "males" FROM table_68315 WHERE "percentage (%)" = '0.42'
wikisql
CREATE TABLE table_39966 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the record of the game where Lebron James (16) was the leading scorer?
SELECT "Record" FROM table_39966 WHERE "Leading scorer" = 'lebron james (16)'
wikisql
CREATE TABLE table_name_44 ( player VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the draft pick that went to college at Oral Roberts?
SELECT player FROM table_name_44 WHERE college = "oral roberts"
sql_create_context
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.admityear < "2139" AND diagnoses.short_title = "Candidias urogenital NEC"
mimicsql_data
CREATE TABLE table_203_799 ( id number, "year" number, "date" text, "title" text, "format(s)" text, "award description(s)" text, "result(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- last award won
SELECT "award description(s)" FROM table_203_799 WHERE "result(s)" = 'won' ORDER BY id DESC LIMIT 1
squall
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40)...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID)
nvbench
CREATE TABLE Shops ( Shop_ID INTEGER, Shop_Details VARCHAR(255) ) CREATE TABLE Features ( Feature_ID INTEGER, Feature_Details VARCHAR(255) ) CREATE TABLE Visits ( Visit_ID INTEGER, Tourist_Attraction_ID INTEGER, Tourist_ID INTEGER, Visit_Date DATETIME, Visit_Details VARCHAR(40) ) ...
SELECT Name, COUNT(*) FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID ORDER BY Name DESC
nvbench
CREATE TABLE table_19218 ( "Team" text, "First Played" real, "Played" real, "Win" real, "Draw" real, "Loss" real, "Points For" real, "Ponts Against" real, "Last Meeting" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games d...
SELECT COUNT("Played") FROM table_19218 WHERE "First Played" = '2011' AND "Points For" = '36'
wikisql
CREATE TABLE table_60749 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What even was held in Valencia, Spain?
SELECT "Event" FROM table_60749 WHERE "Venue" = 'valencia, spain'
wikisql
CREATE TABLE table_23680576_2 ( aug_2008 VARCHAR, sep_2008 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the polling average in Aug 2009 when is was 5.0% in Sep 2009?
SELECT aug_2008 FROM table_23680576_2 WHERE sep_2008 = "5.0%"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.dob_year < "2085"
mimicsql_data
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, ...
SELECT p.Id AS "post_link", p.Score, CreationDate FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 AND p.Score >= 2 AND p.ClosedDate IS NULL AND COALESCE(p.AnswerCount, 0) = 0 AND COALESCE(p.CommentCount, 0) = 0 AND t.TagName = 'r' AND Deletion...
sede
CREATE TABLE table_203_279 ( id number, "interferometer and observing mode" text, "waveband" text, "limiting magnitude" number, "minimum baseline (m)\n(un-projected)" number, "maximum baseline (m)" number, "approx. no. visibility measurements per year\n(measurements per night x nights used p...
SELECT COUNT("interferometer and observing mode") FROM table_203_279 WHERE "approx. no. visibility measurements per year\n(measurements per night x nights used per year)" < 3000
squall
CREATE TABLE table_name_75 ( lead_margin INTEGER, poll_source VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Lead Margin has a Poll Source of rasmussen reports/ fox news?
SELECT MIN(lead_margin) FROM table_name_75 WHERE poll_source = "rasmussen reports/ fox news"
sql_create_context
CREATE TABLE table_79225 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time has phil mcgurk as the rider?
SELECT "Time" FROM table_79225 WHERE "Rider" = 'phil mcgurk'
wikisql
CREATE TABLE table_7436 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date did the Lions play against the Tampa Bay Buccaneers?
SELECT "Date" FROM table_7436 WHERE "Opponent" = 'tampa bay buccaneers'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Rheumatoid arthritis"
mimicsql_data
CREATE TABLE table_name_20 ( duration VARCHAR, test_flight VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Duration, when Test Flight is Taxi Test #2?
SELECT duration FROM table_name_20 WHERE test_flight = "taxi test #2"
sql_create_context
CREATE TABLE table_56112 ( "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. -- When did the away team score 11.7 (73)?
SELECT "Date" FROM table_56112 WHERE "Away team score" = '11.7 (73)'
wikisql
CREATE TABLE table_58717 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the place was t8?
SELECT "Score" FROM table_58717 WHERE "Place" = 't8'
wikisql
CREATE TABLE table_1920271_3 ( partner VARCHAR, surface VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did she play with on clay?
SELECT partner FROM table_1920271_3 WHERE surface = "Clay"
sql_create_context
CREATE TABLE table_name_94 ( player VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player attended Graceland College?
SELECT player FROM table_name_94 WHERE college = "graceland"
sql_create_context
CREATE TABLE financial_transactions ( transaction_id number, previous_transaction_id number, account_id number, card_id number, transaction_type text, transaction_date time, transaction_amount number, transaction_comment text, other_transaction_details text ) CREATE TABLE customers ...
SELECT COUNT(DISTINCT transaction_type) FROM financial_transactions
spider
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'accident in place nec'))
mimic_iii
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 jybgb.BGRQ FROM jybgb WHERE jybgb.BGDH = '11288812225'
css
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE table_name_97 ( high_rebounds VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which High rebounds has a Game of 76?
SELECT high_rebounds FROM table_name_97 WHERE game = 76
sql_create_context
CREATE TABLE table_4976 ( "Tournament" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2012" text, "2013" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value in 2012 if it is 2R in 2013, 1R in 2005, a...
SELECT "2012" FROM table_4976 WHERE "2013" = '2r' AND "2005" = '1r' AND "2008" = '1r'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-4322')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput...
eicu
CREATE TABLE table_936 ( "Number" real, "Astronaut" text, "Agency" text, "Total EVAs" real, "Total Time Hours:Minutes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many agencies did Budarin Nikolai Budarin working for?
SELECT COUNT("Agency") FROM table_936 WHERE "Astronaut" = 'Budarin Nikolai Budarin'
wikisql
CREATE TABLE stay ( stayid number, patient number, room number, staystart time, stayend time ) CREATE TABLE affiliated_with ( physician number, department number, primaryaffiliation boolean ) CREATE TABLE on_call ( nurse number, blockfloor number, blockcode number, onca...
SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.employeeid = T2.physician JOIN department AS T3 ON T2.department = T3.departmentid WHERE T3.name = 'Surgery' INTERSECT SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.employeeid = T2.physician JOIN department AS T3 ON T2.departmen...
spider
CREATE TABLE table_13746 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Total of Player Craig Stadler?
SELECT AVG("Total") FROM table_13746 WHERE "Player" = 'craig stadler'
wikisql
CREATE TABLE table_204_378 ( id number, "no" number, "driver" text, "entrant" text, "constructor" text, "chassis" text, "engine" text, "tyre" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who drives a maserati , chiron or ascari ?
SELECT "driver" FROM table_204_378 WHERE "driver" IN ('louis chiron', 'alberto ascari') AND "constructor" = 'maserati'
squall
CREATE TABLE table_27539535_4 ( record VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every record for game 13?
SELECT record FROM table_27539535_4 WHERE game = 13
sql_create_context
CREATE TABLE MediaType ( MediaTypeId integer, Name varchar(120) ) CREATE TABLE Employee ( EmployeeId integer, LastName varchar(20), FirstName varchar(20), Title varchar(30), ReportsTo integer, BirthDate datetime, HireDate datetime, Address varchar(70), City varchar(40), ...
SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone
nvbench
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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.dob_year > "2097"
mimicsql_data
CREATE TABLE table_46475 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player from Australia with a to par of +5?
SELECT "Player" FROM table_46475 WHERE "To par" = '+5' AND "Country" = 'australia'
wikisql
CREATE TABLE table_14954150_1 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record on September 22, 1974?
SELECT record FROM table_14954150_1 WHERE date = "September 22, 1974"
sql_create_context
CREATE TABLE table_name_92 ( director VARCHAR, language VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the director of the film in Italian?
SELECT director FROM table_name_92 WHERE language = "italian"
sql_create_context
CREATE TABLE table_name_13 ( against INTEGER, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average against of Murrayfield, Edinburgh?
SELECT AVG(against) FROM table_name_13 WHERE venue = "murrayfield, edinburgh"
sql_create_context
CREATE TABLE table_203_99 ( id number, "season" number, "date" text, "driver" text, "team" text, "chassis" text, "engine" text, "race distance\nlaps" number, "race distance\nmiles (km)" text, "race time" text, "average speed\n(mph)" number, "report" text ) -- Using vali...
SELECT COUNT(*) FROM table_203_99 WHERE "engine" = 'honda'
squall
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL"
mimicsql_data
CREATE TABLE table_75247 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game is the highest one that has Points smaller than 92, and a Score of 1 3?
SELECT MAX("Game") FROM table_75247 WHERE "Points" < '92' AND "Score" = '1–3'
wikisql
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
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 = 'ATLANTA' AND date_day.day_number = 22 AND date_day.month_number = 3 AND ...
atis
CREATE TABLE table_30693 ( "Rank" real, "Player" text, "Year" real, "Opponent" text, "Passing yards" real, "Rushing yards" real, "Total offense" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rushing yards are listed when the passin...
SELECT "Rushing yards" FROM table_30693 WHERE "Passing yards" = '244'
wikisql
CREATE TABLE table_56963 ( "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 the name of the venue that away team foo...
SELECT "Venue" FROM table_56963 WHERE "Away team" = 'footscray'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID ...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID
nvbench
CREATE TABLE table_42920 ( "Opposition" text, "Span" text, "Lost" real, "Tied" real, "Win %" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Win % in the Span of 2011 2013 with a Lost of less than 1?
SELECT AVG("Win %") FROM table_42920 WHERE "Span" = '2011–2013' AND "Lost" < '1'
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 COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '褚雨伯' AND t_kc22.STA_DATE BETWEEN '2010-11-02' AND '2016-08-24' AND t_kc22.SOC_SRT_DIRE_CD = '477789-7' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '褚雨伯...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND lab.label = "RDW"
mimicsql_data
CREATE TABLE table_25526 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 'past tense' is the title who is the writer?
SELECT "Written by" FROM table_25526 WHERE "Title" = 'Past Tense'
wikisql
CREATE TABLE table_71727 ( "Number" real, "Name" text, "Builder" text, "Type" text, "Works number" real, "Date" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number with the builder hunslet and a works number greater than 822?
SELECT COUNT("Number") FROM table_71727 WHERE "Builder" = 'hunslet' AND "Works number" > '822'
wikisql
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, program_course AS PROGRAM_COURSEalias0...
advising
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2105" AND diagnoses.short_title = "Iron defic anemia NOS"
mimicsql_data
CREATE TABLE table_25866 ( "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 l...
SELECT "Location Attendance" FROM table_25866 WHERE "Record" = '9-4'
wikisql
CREATE TABLE table_62160 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a To par larger than 3, and a Year(s) won of 1979? Question 1
SELECT "Country" FROM table_62160 WHERE "To par" > '3' AND "Year(s) won" = '1979'
wikisql