instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_38772 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At which games was a bronze medal won in the 94kg men's weightlifting event?
SELECT "Games" FROM table_38772 WHERE "Medal" = 'bronze' AND "Sport" = 'weightlifting' AND "Event" = '94kg men''s weightlifting'
wikisql
CREATE TABLE table_28715942_6 ( original_artist VARCHAR, vocal_percussionist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the artist where the vocal percussionist is Benjamin Holder?
SELECT original_artist FROM table_28715942_6 WHERE vocal_percussionist = "Benjamin Holder"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, U...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS NowRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsNow, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND ...
sede
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE table_41672 ( "Model Number" text, "Frequency" text, "L2-Cache" text, "Multiplier 1" text, "Voltage" text, "Socket" text, "Release date" text, "Order Part Number" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mu...
SELECT "Multiplier 1" FROM table_41672 WHERE "Frequency" = '1800mhz'
wikisql
CREATE TABLE table_39009 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for venue of jalan besar, singapore
SELECT "Score" FROM table_39009 WHERE "Venue" = 'jalan besar, singapore'
wikisql
CREATE TABLE table_name_86 ( club VARCHAR, league VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which club has a League of american basketball association, and a Venue of tba?
SELECT club FROM table_name_86 WHERE league = "american basketball association" AND venue = "tba"
sql_create_context
CREATE TABLE table_51698 ( "Year" real, "Theme" text, "Artist" text, "Composition" text, "Mintage" real, "Issue Price" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year when the composition is 99.99% silver and the issue p...
SELECT MIN("Year") FROM table_51698 WHERE "Composition" = '99.99% silver' AND "Issue Price" = '$94.95'
wikisql
CREATE TABLE table_35724 ( "Trim" text, "Engine" text, "Displacement" text, "Power" text, "Torque" text, "Transmission" text, "Fuel Mileage (latest EPA mpg - US )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Torque that has a ...
SELECT "Torque" FROM table_35724 WHERE "Power" = 'hp (kw)' AND "Trim" = 'xr (2009)'
wikisql
CREATE TABLE table_name_31 ( LNER VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What LNER Class has a Class of 6db?
SELECT LNER AS class FROM table_name_31 WHERE class = "6db"
sql_create_context
CREATE TABLE table_69042 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Position of Pick #23 in a Round less than 5 with 23 Overall?
SELECT "Position" FROM table_69042 WHERE "Round" < '5' AND "Pick #" = '23' AND "Overall" = '23'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT * FROM t_kc21 WHERE PERSON_ID = '59383313' AND MED_SER_ORG_NO = '5882181' AND MED_ORG_DEPT_NM LIKE '%复工%'
css
CREATE TABLE table_28191 ( "Metropolitan ring" text, "Localities" real, "Total" real, "Jews and others 1" real, "Thereof: Jews" real, "Arabs" real, "Population density (per km\u00b2)" text, "Annual Population growth rate" text ) -- Using valid SQLite, answer the following questions for...
SELECT MAX("Jews and others 1") FROM table_28191
wikisql
CREATE TABLE table_name_19 ( tournament VARCHAR, surface VARCHAR, opponents_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament has a hard surface and final opponents rohan bopanna & mustafa ghouse?
SELECT tournament FROM table_name_19 WHERE surface = "hard" AND opponents_in_the_final = "rohan bopanna & mustafa ghouse"
sql_create_context
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
SELECT Year, MAX(Price) FROM wine GROUP BY Year ORDER BY Year
nvbench
CREATE TABLE table_44559 ( "Poll Source" text, "Dates administered" text, "Democrat: Carl Levin" text, "Republican: Jack Hoogendyk" text, "Lead Margin" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Democrat: Carl Levin, when Lead Margin is ...
SELECT "Democrat: Carl Levin" FROM table_44559 WHERE "Lead Margin" = '22'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.insurance = "Self Pay"
mimicsql_data
CREATE TABLE table_2181798_1 ( top_5 INTEGER, avg_finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the max top 5 for avg finish being 27.6
SELECT MAX(top_5) FROM table_2181798_1 WHERE avg_finish = "27.6"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUser...
SELECT COUNT(*) AS questions, SUM(q.ViewCount) AS views, MAX(a.CreationDate) AS lastAnswerDate FROM Posts AS a JOIN Posts AS q ON q.Id = a.ParentId WHERE a.OwnerUserId = @userId AND a.PostTypeId = 2 AND q.PostTypeId = 1
sede
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give the proportion of how ...
SELECT gender, COUNT(*) FROM Person WHERE age < 40 GROUP BY gender
nvbench
CREATE TABLE table_name_83 ( pop_dens VARCHAR, population INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the population density of the area with a population larger than 92,719?
SELECT COUNT(pop_dens) FROM table_name_83 WHERE population > 92 OFFSET 719
sql_create_context
CREATE TABLE table_43489 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Crowd" real, "Box Score" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Venue that has the Away t...
SELECT "Venue" FROM table_43489 WHERE "Away team" = 'south dragons'
wikisql
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '尤静逸' AND hz_info.YLJGDM = '0738891' AND mzjzjlb.JZZDSM LIKE '%神经衰弱%'
css
CREATE TABLE table_2870 ( "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 games did they play on february 5?
SELECT "Opponent" FROM table_2870 WHERE "Date" = 'February 5'
wikisql
CREATE TABLE table_name_63 ( race VARCHAR, pole_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What race had Jody Scheckter hold pole position?
SELECT race FROM table_name_63 WHERE pole_position = "jody scheckter"
sql_create_context
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH"
mimicsql_data
CREATE TABLE table_name_45 ( opponent VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent when the time was 1:47?
SELECT opponent FROM table_name_45 WHERE time = "1:47"
sql_create_context
CREATE TABLE table_41365 ( "Year" real, "Venue" text, "Location" text, "Winners" text, "Runners-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location when France was the runner-up at club de campo?
SELECT "Location" FROM table_41365 WHERE "Runners-up" = 'france' AND "Venue" = 'club de campo'
wikisql
CREATE TABLE table_15185133_1 ( original_air_date VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original air date for the episode with a production code of 318?
SELECT original_air_date FROM table_15185133_1 WHERE production_code = 318
sql_create_context
CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE dorm ...
SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1
spider
CREATE TABLE table_name_34 ( team VARCHAR, day_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team had 3:18.513 on day 1?
SELECT team FROM table_name_34 WHERE day_1 = "3:18.513"
sql_create_context
CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality
nvbench
CREATE TABLE Parts ( part_id INTEGER, part_name VARCHAR(255), chargeable_yn VARCHAR(1), chargeable_amount VARCHAR(20), other_part_details VARCHAR(255) ) CREATE TABLE Fault_Log ( fault_log_entry_id INTEGER, asset_id INTEGER, recorded_by_staff_id INTEGER, fault_log_entry_datetime DATE...
SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY COUNT(asset_make) DESC
nvbench
CREATE TABLE table_66593 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player played for the Boston Patriots?
SELECT "Player" FROM table_66593 WHERE "Team" = 'boston patriots'
wikisql
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 6 AND program_course.category LIKE 'ULCS'
advising
CREATE TABLE table_name_37 ( date VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Visitor is Toronto?
SELECT date FROM table_name_37 WHERE visitor = "toronto"
sql_create_context
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND demographic.age < "61"
mimicsql_data
CREATE TABLE table_name_65 ( lost INTEGER, points VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average losses for team with points larger than 3 and played larger thna 14?
SELECT AVG(lost) FROM table_name_65 WHERE points > 3 AND played > 14
sql_create_context
CREATE TABLE table_name_15 ( play_by_play VARCHAR, year VARCHAR, ice_level_reporters VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did the play-by-play before 1992 with the Ice level reporter Mike Emrick?
SELECT play_by_play FROM table_name_15 WHERE year < 1992 AND ice_level_reporters = "mike emrick"
sql_create_context
CREATE TABLE table_name_86 ( score VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Ernie Els's score?
SELECT score FROM table_name_86 WHERE player = "ernie els"
sql_create_context
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Ra...
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_12125 ( "Player" text, "Height" real, "Position" text, "Year born (Age)" text, "Current Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position for the player from the Alba Berlin club who is taller than 1.96 and...
SELECT "Position" FROM table_12125 WHERE "Current Club" = 'alba berlin' AND "Height" > '1.96' AND "Year born (Age)" = 'july 23, 1985 (age28)'
wikisql
CREATE TABLE table_train_104 ( "id" int, "migraines" bool, "depression" bool, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "renal_disease" bool, "alzheimer" bool, "estimated_glomerular_filtration_rate_egfr" int, "diastolic_blood_pressure_dbp" int, ...
SELECT * FROM table_train_104 WHERE migraines = 0
criteria2sql
CREATE TABLE table_64955 ( "Player" text, "Current Club" text, "Born" text, "Debut" text, "Manager" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the club for Sam Magri?
SELECT "Current Club" FROM table_64955 WHERE "Player" = 'sam magri'
wikisql
CREATE TABLE table_36154 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text, "Alternate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the alternate of the nation with Piotras Gerasimovici as the second?
SELECT "Alternate" FROM table_36154 WHERE "Second" = 'piotras gerasimovici'
wikisql
CREATE TABLE employees ( employee_id VARCHAR, first_name VARCHAR, last_name VARCHAR, salary INTEGER, department_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- display the employee number, name( first name and last name ), and salary for all em...
SELECT employee_id, first_name, last_name, salary FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) AND department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%J%')
sql_create_context
CREATE TABLE table_name_98 ( constructor VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which constructor makes the ej15 ej15b chassis?
SELECT constructor FROM table_name_98 WHERE chassis = "ej15 ej15b"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 44848) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-6 month') ORDER BY labevents.charttime LIM...
mimic_iii
CREATE TABLE table_23718905_6 ( television VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the television that was dated December 28, 2009?
SELECT television FROM table_23718905_6 WHERE date = "December 28, 2009"
sql_create_context
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT DISTINCT total_credit FROM student WHERE student_id = 1
advising
CREATE TABLE table_50805 ( "Year" text, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the League which has a Regular Season of 3rd, atlantic?
SELECT "League" FROM table_50805 WHERE "Regular Season" = '3rd, atlantic'
wikisql
CREATE TABLE table_204_554 ( id number, "rank" number, "name" text, "nation" text, "time" text, "speed" number, "note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who finished before ellen van dijk ?
SELECT "name" FROM table_204_554 WHERE "rank" < (SELECT "rank" FROM table_204_554 WHERE "name" = 'ellen van dijk') ORDER BY "rank" DESC LIMIT 1
squall
CREATE TABLE table_45202 ( "Name" text, "Category" text, "Eliminated" text, "Date" text, "Special Guest" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the special guest when the category was vocal groups and the name was Romantic?
SELECT "Special Guest" FROM table_45202 WHERE "Category" = 'vocal groups' AND "Name" = 'romantic'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, Creati...
SELECT p.Id AS "closed_questions", p.ClosedDate FROM Posts AS p INNER JOIN PostHistory AS h ON h.PostId = p.Id WHERE h.PostHistoryTypeId = 10 AND h.Comment = 102 AND NOT p.ClosedDate IS NULL ORDER BY p.ClosedDate
sede
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 Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Ln...
SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex
nvbench
CREATE TABLE table_7752 ( "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 sum of Total, when Nation is West Germany, and when Gold is greater than 2?
SELECT SUM("Total") FROM table_7752 WHERE "Nation" = 'west germany' AND "Gold" > '2'
wikisql
CREATE TABLE table_name_94 ( actor VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What actor was nominated for or won an award before 1971?
SELECT actor FROM table_name_94 WHERE year < 1971
sql_create_context
CREATE TABLE table_5650 ( "Name" text, "Tenure" text, "Courtesy title" text, "Court Rank" text, "revenues" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the tenure of the person with revenues of 60,000-->58,000 koku?
SELECT "Tenure" FROM table_5650 WHERE "revenues" = '60,000-->58,000 koku'
wikisql
CREATE TABLE table_42380 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the surface for October 10, 2004?
SELECT "Surface" FROM table_42380 WHERE "Date" = 'october 10, 2004'
wikisql
CREATE TABLE table_name_67 ( guest VARCHAR, date VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the gues on 25.11.07 when home was stade nyonnais (1.l)?
SELECT guest FROM table_name_67 WHERE date = "25.11.07" AND home = "stade nyonnais (1.l)"
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2194" AND procedures.short_title = "Arterial catheterization"
mimicsql_data
CREATE TABLE table_49056 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which city is the station licensed whose frequency MHz is higher ...
SELECT "City of license" FROM table_49056 WHERE "Frequency MHz" > '102.3' AND "Call sign" = 'k292eu'
wikisql
CREATE TABLE table_name_70 ( rider VARCHAR, laps VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the rider with 22 laps and a +1:44.775 time/retired?
SELECT rider FROM table_name_70 WHERE laps = "22" AND time_retired = "+1:44.775"
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 lab ( subject_id text, hadm_id text, ...
SELECT demographic.dob, demographic.insurance FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, ...
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 (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_nam...
atis
CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number )...
SELECT AVG(salary), MAX(salary) FROM employee
spider
CREATE TABLE table_name_66 ( player VARCHAR, caps VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Player, when Caps is Example, and when Position is Center?
SELECT player FROM table_name_66 WHERE caps = "example" AND position = "center"
sql_create_context
CREATE TABLE table_203_494 ( id number, "party" text, "votes" number, "%" number, "swing" number, "seats" number, "change" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who got more votes ? nationals sa or independent ?
SELECT "party" FROM table_203_494 WHERE "party" IN ('nationals sa', 'independent') ORDER BY "votes" DESC LIMIT 1
squall
CREATE TABLE table_41596 ( "Rank" real, "Name" text, "Years" text, "Matches" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total amount of matches for Alan Shearer?
SELECT COUNT("Matches") FROM table_41596 WHERE "Name" = 'alan shearer'
wikisql
CREATE TABLE table_name_10 ( state VARCHAR, title VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which state has a king named xiang?
SELECT state FROM table_name_10 WHERE title = "king" AND name = "xiang"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, a...
SELECT DISTINCT flight_id FROM flight WHERE (((departure_time < 1800 AND flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 26 AND DATE_DAYalias0.month_number = 7 AND DATE_DAYa...
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.religion, demographic.days_stay FROM demographic WHERE demographic.subject_id = "29961"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Hydrocortisone Cream 0.5%"
mimicsql_data
CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE train ( id int, train...
SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services
nvbench
CREATE TABLE table_name_11 ( election VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2nd Party has an Election of 1834?
SELECT 2 AS nd_party FROM table_name_11 WHERE election = "1834"
sql_create_context
CREATE TABLE table_1341598_10 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what district is the incumbent Lawrence J. Smith?
SELECT district FROM table_1341598_10 WHERE incumbent = "Lawrence J. Smith"
sql_create_context
CREATE TABLE table_47815 ( "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 d...
SELECT "Date" FROM table_47815 WHERE "High points" = 'mehmet okur (24)'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'sodium chloride 0.45%')
eicu
CREATE TABLE table_name_83 ( date VARCHAR, score VARCHAR, game VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Game smaller than 4, and an Opponent of calgary flames, and a Score of 4 5?
SELECT date FROM table_name_83 WHERE game < 4 AND opponent = "calgary flames" AND score = "4–5"
sql_create_context
CREATE TABLE table_203_299 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the only event won in belgium ?
SELECT "competition" FROM table_203_299 WHERE "venue" = 'belgium'
squall
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-11154...
eicu
CREATE TABLE table_name_6 ( wireless_network VARCHAR, screen_type VARCHAR, internal_storage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which wireless network did LCD displays with 4 GB of internal storage use?
SELECT wireless_network FROM table_name_6 WHERE screen_type = "lcd" AND internal_storage = "4 gb"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-53836')) AND lab.labname = 'anion gap' AND DATETIME(lab.labresulttime) <= DATETIME(CURRE...
eicu
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. -- who was the opponent in the last game of the s...
SELECT "opponent" FROM table_204_523 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_225200_4 ( reason_for_change VARCHAR, date_successor_seated VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of reason for change for not filled this congress
SELECT COUNT(reason_for_change) FROM table_225200_4 WHERE date_successor_seated = "Not filled this congress"
sql_create_context
CREATE TABLE table_24047 ( "Displacement" text, "Bore" text, "Stroke" text, "Cylinders" text, "Valves" real, "Power" text, "Torque" text, "Applications" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the greatest number of valves...
SELECT MIN("Valves") FROM table_24047
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-72731') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.uni...
eicu
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE TagSynonyms ( Id number...
SELECT COUNT(a.Id) AS "total_answers", SUM(CASE q.AcceptedAnswerId WHEN a.Id THEN 1 ELSE 0 END) AS "accepted_answers", ROUND(SUM(CASE q.AcceptedAnswerId WHEN a.Id THEN 1 ELSE 0 END) * 100.0 / COUNT(a.Id), 1) AS "percentage_accepted" FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id WHERE a.OwnerUserId = 11742502 AND...
sede
CREATE TABLE table_3374 ( "Skip (Club)" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number for...
SELECT MAX("W") FROM table_3374
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Diabetes with ophthalmic manifestations, type II or unspecified type, not stated as uncontrolled" AND lab.flag ...
mimicsql_data
CREATE TABLE table_941 ( "Year" real, "Domestic freight" real, "Domestic mail" real, "International freight" real, "International mail" real, "Total freight and mail" real, "Change" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the d...
SELECT "Domestic freight" FROM table_941 WHERE "Change" = '+8.0%'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '72214494' AND t_kc22.STA_DATE BETWEEN '2003-07-26' AND '2015-04-29' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_58887 ( "Circuit" text, "City / State" text, "Date" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Winner, when Team is 'R.J.MacArthur Onslow', and when Circuit is 'Oran Park Raceway'?
SELECT "Winner" FROM table_58887 WHERE "Team" = 'r.j.macarthur onslow' AND "Circuit" = 'oran park raceway'
wikisql
CREATE TABLE table_204_888 ( id number, "location" text, "mile" number, "destinations" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the first destination after berkeley springs , wv ?
SELECT "destinations" FROM table_204_888 WHERE id = (SELECT id FROM table_204_888 WHERE "destinations" = 'us 522 south - berkeley springs, wv') + 1
squall
CREATE TABLE table_26061 ( "Episode #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text, "Production code #" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the title of the episode wr...
SELECT "Title" FROM table_26061 WHERE "Written by" = 'Harry Winkler'
wikisql
CREATE TABLE table_28138035_26 ( mens_doubles VARCHAR, mens_singles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the mens doubles when wang hao won the mens singles?
SELECT mens_doubles FROM table_28138035_26 WHERE mens_singles = "Wang Hao"
sql_create_context
CREATE TABLE table_203_296 ( id number, "country" text, "total gdp (nominal)\n(billion us$)" text, "gdp per capita\n(us$, ppp)" text, "gdp growth,\n2007-2011\n(in %)" number, "hdi" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- seychelles and gu...
SELECT "total gdp (nominal)\n(billion us$)" FROM table_203_296 WHERE "country" = 'seychelles'
squall
CREATE TABLE table_204_894 ( id number, "season" number, "winner" text, "score" text, "runners-up" text, "venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which team was the winner the most times ?
SELECT "winner" FROM table_204_894 GROUP BY "winner" ORDER BY COUNT(*) DESC LIMIT 1
squall
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM 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.IN_DIAG_DIS_CD = 'B00.463'
css
CREATE TABLE table_54205 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who drive the car that retired due to engine failure and a grid of less than 9?
SELECT "Driver" FROM table_54205 WHERE "Time/Retired" = 'engine' AND "Grid" < '9'
wikisql