instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE EMPLOYEE ( EmployeeId VARCHAR ) CREATE TABLE CUSTOMER ( LastName VARCHAR, SupportRepId VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Please show the employee last names that serves no more than 20 customers.
SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) <= 20
sql_create_context
CREATE TABLE table_203_81 ( id number, "date" text, "constituency" text, "gain" text, "loss" text, "note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what 's the total number of dates listed for 1964 ?
SELECT COUNT("date") FROM table_203_81 WHERE "date" = 1964
squall
CREATE TABLE table_67247 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the visitor on January 24?
SELECT "Visitor" FROM table_67247 WHERE "Date" = 'january 24'
wikisql
CREATE TABLE table_47747 ( "Elector" text, "Nationality" text, "Order and title" text, "Elevated" text, "Elevator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the elevator when the Cardinal-Deacon of S. Nicola in Carcere Tulliano was the ...
SELECT "Elevator" FROM table_47747 WHERE "Order and title" = 'cardinal-deacon of s. nicola in carcere tulliano'
wikisql
CREATE TABLE table_name_22 ( album VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1995 Album?
SELECT album FROM table_name_22 WHERE year = 1995
sql_create_context
CREATE TABLE table_74814 ( "Rank" real, "Mountain Pass" text, "Elevation" text, "Surface" text, "Route" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Mountain Pass has an Elevation of 10,001 feet 3048 m?
SELECT "Mountain Pass" FROM table_74814 WHERE "Elevation" = '10,001 feet 3048 m'
wikisql
CREATE TABLE table_6998 ( "Member State" text, "2005" real, "2006" real, "2007" real, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2011 value with a 2008 value ...
SELECT "2011" FROM table_6998 WHERE "2008" = '0.3' AND "Member State" = 'european union'
wikisql
CREATE TABLE table_49425 ( "Player" text, "Team" text, "Matches" real, "Overs" real, "Wickets" real, "Economy Rate" real, "Average" real, "Strike Rate" real, "Best Bowling" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the a...
SELECT AVG("Average") FROM table_49425 WHERE "Wickets" > '19' AND "Matches" < '16'
wikisql
CREATE TABLE table_70818 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Try BP" text, "Losing BP" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Losing BP with 22 played and 9 Try BP.
SELECT "Losing BP" FROM table_70818 WHERE "Played" = '22' AND "Try BP" = '9'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "ANGIOEDEMA"
mimicsql_data
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '0357577' AND jybgb.BGRQ BETWEEN '2005-02-27' AND '2010-04-30' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 12) AS T
css
CREATE TABLE table_name_38 ( earnings__ INTEGER, rank INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has the lowest earnings that has a rank smaller than 2?
SELECT MIN(earnings__) AS $__ FROM table_name_38 WHERE rank < 2
sql_create_context
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text ...
SELECT 'A' + CAST(AnswerCount AS TEXT(3)) + 'C' + CAST(CommentCount AS TEXT(3)) FROM Posts WHERE Id = 2913
sede
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propul...
SELECT DISTINCT flight.flight_id FROM date_day, days, flight WHERE date_day.day_number = 26 AND date_day.month_number = 9 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code
atis
CREATE TABLE table_name_65 ( leading_scorer VARCHAR, visitor VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Leading scorer with a Visitor of grizzlies, and with a Score with 114 111?
SELECT leading_scorer FROM table_name_65 WHERE visitor = "grizzlies" AND score = "114–111"
sql_create_context
CREATE TABLE table_204_206 ( id number, "saros" number, "member" number, "date" text, "time\n(greatest)\nutc" text, "type" text, "location\nlat,long" text, "gamma" number, "mag." number, "width\n(km)" number, "duration\n(min:sec)" text, "ref" number ) -- Using valid SQL...
SELECT "saros" FROM table_204_206 WHERE "date" = 'july 30, 2307'
squall
CREATE TABLE table_name_47 ( profit__loss__before_tax__ VARCHAR, year_ended VARCHAR, net_profit__£m_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In year 2011 what is sum of profit/loss before tax and net profit larger than 123.8 million?
SELECT COUNT(profit__loss__before_tax__) AS £m_ FROM table_name_47 WHERE year_ended = "2011" AND net_profit__£m_ > 123.8
sql_create_context
CREATE TABLE table_50007 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the tie number for the round against visiting opponent Newcastle United?
SELECT "Tie no" FROM table_50007 WHERE "Away team" = 'newcastle united'
wikisql
CREATE TABLE table_39483 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was the margin of victory 1 stroke when the tournament was colonial nat...
SELECT "Date" FROM table_39483 WHERE "Margin of victory" = '1 stroke' AND "Tournament" = 'colonial national invitation'
wikisql
CREATE TABLE table_70319 ( "Date" text, "Opponent" text, "Home/Away" text, "Field" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What days were games played at Hofstra Stadium?
SELECT "Date" FROM table_70319 WHERE "Field" = 'hofstra stadium'
wikisql
CREATE TABLE table_79135 ( "Date" text, "Result" text, "Score" text, "Opponent" text, "Record" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score has houston texans as the opponent?
SELECT "Score" FROM table_79135 WHERE "Opponent" = 'houston texans'
wikisql
CREATE TABLE table_name_27 ( rank INTEGER, gross VARCHAR, screens VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest rank of the day with a gross of $38,916 and more than 6 screens?
SELECT MAX(rank) FROM table_name_27 WHERE gross = "$38,916" AND screens > 6
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 Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name
nvbench
CREATE TABLE table_12262182_2 ( date VARCHAR, titles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the match for the wbc flyweight (112) title?
SELECT date FROM table_12262182_2 WHERE titles = "WBC Flyweight (112)"
sql_create_context
CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE volume ( Volume_ID int, V...
SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result ORDER BY COUNT(Result)
nvbench
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 WHERE demographic.gender = "F" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE"
mimicsql_data
CREATE TABLE table_name_90 ( points VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points did the 2005 1st place team receive?
SELECT points FROM table_name_90 WHERE year = 2005
sql_create_context
CREATE TABLE team_franchise ( franchise_id TEXT, franchise_name TEXT, active TEXT, na_assoc TEXT ) CREATE TABLE home_game ( year INTEGER, league_id TEXT, team_id TEXT, park_id TEXT, span_first TEXT, span_last TEXT, games INTEGER, openings INTEGER, attendance INTEGER ...
SELECT yearid, COUNT(yearid) FROM hall_of_fame ORDER BY yearid DESC
nvbench
CREATE TABLE table_65201 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Nationality of the swimmer with a Time of 1:08.80?
SELECT "Nationality" FROM table_65201 WHERE "Time" = '1:08.80'
wikisql
CREATE TABLE table_21163 ( "Position" real, "Driver / Passenger" text, "Equipment" text, "Bike No" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the equipment for bike number 6
SELECT "Equipment" FROM table_21163 WHERE "Bike No" = '6'
wikisql
CREATE TABLE table_name_40 ( race_2 VARCHAR, race_4 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Race 2, when Race 4 is 28?
SELECT race_2 FROM table_name_40 WHERE race_4 = "28"
sql_create_context
CREATE TABLE table_39857 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the game average that has a rank larger than 2 with team Olympiacos and points larger than 113?
SELECT AVG("Games") FROM table_39857 WHERE "Rank" > '2' AND "Team" = 'olympiacos' AND "Points" > '113'
wikisql
CREATE TABLE races ( raceId INTEGER, year INTEGER, round INTEGER, circuitId INTEGER, name TEXT, date TEXT, time TEXT, url TEXT ) CREATE TABLE seasons ( year INTEGER, url TEXT ) CREATE TABLE status ( statusId INTEGER, status TEXT ) CREATE TABLE constructorStandings ( ...
SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name
nvbench
CREATE TABLE table_50277 ( "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 a...
SELECT "High points" FROM table_50277 WHERE "Team" = 'utah'
wikisql
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE patient ( name VARCHAR, SSN VARCHAR ) CREATE TABLE undergoes ( patient VARCHAR, Stay VARCHAR ) CREATE TABLE stay ( StayID VARCHAR, room VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the names of all patients who have an u...
SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay = T3.StayID WHERE T3.room = 111
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( I...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%poland%' OR UPPER(Location) LIKE '%POLAND%' OR Location LIKE '%Poland%') AND Reputation >= 1000 AND Id IN (SELECT OwnerUserId FROM Posts WHERE LOWER(Tags) LIKE '%node.js%') ORDER BY Reputat...
sede
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_lo...
SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'MKE' AND city.city_code = airport_service.city_code AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code
atis
CREATE TABLE table_name_69 ( away_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the away team at Windy Hill?
SELECT away_team FROM table_name_69 WHERE venue = "windy hill"
sql_create_context
CREATE TABLE table_name_88 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what day was the record 30-31?
SELECT date FROM table_name_88 WHERE record = "30-31"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2121" AND diagnoses.long_title = "Personal history of transient ischemic attack (TIA), and cerebral infarction without residual deficits"
mimicsql_data
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TA...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS V...
atis
CREATE TABLE table_name_9 ( record VARCHAR, game VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Record that has the Game larger than 15, and the Opponent of edmonton oilers?
SELECT record FROM table_name_9 WHERE game > 15 AND opponent = "edmonton oilers"
sql_create_context
CREATE TABLE table_204_614 ( id number, "date announced" text, "plant name" text, "location" text, "date of closing" text, "products" text, "employees" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which plant is listed first ?
SELECT "plant name" FROM table_204_614 WHERE id = 1
squall
CREATE TABLE table_train_149 ( "id" int, "prostate_specific_antigen_psa" float, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "fasting_serum_glucose" int, "vitamin_d" int, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- fast...
SELECT * FROM table_train_149 WHERE fasting_serum_glucose > 300
criteria2sql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT SUM(PER_ACC_PAY) FROM t_kc24 WHERE PERSON_ID = '09976538' AND CLINIC_SLT_DATE BETWEEN '2013-12-07' AND '2014-04-01'
css
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-42654') AND NOT patient.unitdischargetime IS...
eicu
CREATE TABLE table_68240 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team with best of 58.846
SELECT "Team" FROM table_68240 WHERE "Best" = '58.846'
wikisql
CREATE TABLE table_66139 ( "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 notes for the time 6:05.21?
SELECT "Notes" FROM table_66139 WHERE "Time" = '6:05.21'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE diagnosis ( diagn...
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-584' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_12792876_4 ( tries_against VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tries against for 87 points
SELECT tries_against FROM table_12792876_4 WHERE points = "87"
sql_create_context
CREATE TABLE table_15879 ( "Player" text, "No." text, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players were with the school or club team La Salle?
SELECT COUNT("Player") FROM table_15879 WHERE "School/Club Team" = 'La Salle'
wikisql
CREATE TABLE ref_characteristic_types ( characteristic_type_code text, characteristic_type_description text ) CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, unit_of_measure text ) CREATE TABLE ref_colors ( color_code text, color_descrip...
SELECT color_description FROM ref_colors
spider
CREATE TABLE table_name_7 ( points INTEGER, entrant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lowest points for officine alfieri maserati
SELECT MIN(points) FROM table_name_7 WHERE entrant = "officine alfieri maserati"
sql_create_context
CREATE TABLE table_38337 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the position of terry jones whose pick number was after 256?
SELECT "Position" FROM table_38337 WHERE "Pick" > '256' AND "Player" = 'terry jones'
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(qtb.MED_SER_ORG_NO) FROM qtb WHERE qtb.PERSON_ID = '76964700' AND qtb.IN_HOSP_DATE BETWEEN '2011-03-25' AND '2021-05-09' UNION SELECT COUNT(gyb.MED_SER_ORG_NO) FROM gyb WHERE gyb.PERSON_ID = '76964700' AND gyb.IN_HOSP_DATE BETWEEN '2011-03-25' AND '2021-05-09' UNION SELECT COUNT(zyb.MED_SER_ORG_NO) FROM zy...
css
CREATE TABLE table_78831 ( "Country" text, "Career" text, "Victories" real, "Super G" text, "Giant Slalom" text, "Slalom" text, "Combined" text, "Parallel" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Super G has a Career of 1980 ...
SELECT "Super G" FROM table_78831 WHERE "Career" = '1980–1996'
wikisql
CREATE TABLE table_19473 ( "No. in series" real, "Title" text, "Written by" text, "Directed by" text, "Original air date" text, "TV broadcast" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who directed with original air date being november18,19...
SELECT "Directed by" FROM table_19473 WHERE "Original air date" = 'November18,1995'
wikisql
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.arrival_time = 1900 AND flight.to_airport = AIRPORT_SERVICE_1.airpo...
atis
CREATE TABLE table_name_73 ( rank INTEGER, candidate_name VARCHAR, votes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank is aliyya qadi with less than 1421 votes?
SELECT MIN(rank) FROM table_name_73 WHERE candidate_name = "aliyya qadi" AND votes < 1421
sql_create_context
CREATE TABLE table_16729063_1 ( nfl_team VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team has draft picks from Mississippi?
SELECT nfl_team FROM table_16729063_1 WHERE college = "Mississippi"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MESENTERIC ISCHEMIA" AND demographic.dob_year < "2180"
mimicsql_data
CREATE TABLE table_64145 ( "Channel" real, "Video" text, "Aspect" text, "PSIP Short Name" text, "Programming" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Video has a Channel smaller than 35.66, and a Programming of nhk world?
SELECT "Video" FROM table_64145 WHERE "Channel" < '35.66' AND "Programming" = 'nhk world'
wikisql
CREATE TABLE table_name_96 ( country VARCHAR, builder VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the country of Palmers Shipbuilding and Iron Company?
SELECT country FROM table_name_96 WHERE builder = "palmers shipbuilding and iron company"
sql_create_context
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) ...
SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY cName DESC
nvbench
CREATE TABLE table_name_48 ( competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the competition that was on august 25, 2007
SELECT competition FROM table_name_48 WHERE date = "august 25, 2007"
sql_create_context
CREATE TABLE table_name_45 ( score VARCHAR, country VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Score that has the Country of united states, and the To par of 8?
SELECT score FROM table_name_45 WHERE country = "united states" AND to_par = 8
sql_create_context
CREATE TABLE table_58668 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Surface, when Tournament is 'Sunderland , United Kingdom'?
SELECT "Surface" FROM table_58668 WHERE "Tournament" = 'sunderland , united kingdom'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description...
SELECT q.Id AS "post_link", a.Id AS "post_link" FROM Posts AS a LEFT JOIN Posts AS q ON a.PostTypeId = 2 AND q.PostTypeId = 1 AND q.AcceptedAnswerId = a.Id WHERE a.Score = 0
sede
CREATE TABLE table_name_97 ( position INTEGER, drawn VARCHAR, against VARCHAR, difference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has an Against of 32, and a Difference of 18, and a Drawn larger than 4?
SELECT SUM(position) FROM table_name_97 WHERE against = 32 AND difference = "18" AND drawn > 4
sql_create_context
CREATE TABLE table_12962773_2 ( player VARCHAR, height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player is 2.01 m tall?
SELECT player FROM table_12962773_2 WHERE height = "2.01"
sql_create_context
CREATE TABLE csu_fees ( campusfee VARCHAR, campus VARCHAR, year VARCHAR ) CREATE TABLE campuses ( id VARCHAR, campus VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the campus fee of 'San Francisco State University' in year 2000?
SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Francisco State University" AND t1.year = 2000
sql_create_context
CREATE TABLE table_77339 ( "Call sign" text, "Frequency" text, "City of license" text, "State" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the FCC info for the radio station in West Lafayette, Indiana?
SELECT "FCC info" FROM table_77339 WHERE "State" = 'indiana' AND "City of license" = 'west lafayette'
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 txmzjzjlb.JZLSH FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '55748768' AND hz_info.YLJGDM = '3373155' AND txmzjzjlb.JZKSMC LIKE '%推拿%' UNION SELECT ftxmzjzjlb.JZLSH FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJG...
css
CREATE TABLE table_15161170_1 ( champion_score VARCHAR, division VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the division is Division 2 men what is the champion score?
SELECT champion_score FROM table_15161170_1 WHERE division = "division 2 Men"
sql_create_context
CREATE TABLE table_25829 ( "Episode #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many original air dates did episode 12 have?h
SELECT COUNT("Original air date") FROM table_25829 WHERE "Episode #" = '12'
wikisql
CREATE TABLE table_name_58 ( player VARCHAR, position VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the player with position of G and the team was the Washington Capitols?
SELECT player FROM table_name_58 WHERE position = "g" AND team = "washington capitols"
sql_create_context
CREATE TABLE table_41686 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries For" text, "Tries Against" text, "Try Bonus" text, "Losing Bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Points for" FROM table_41686 WHERE "Club" = 'cambrian welfare rfc'
wikisql
CREATE TABLE table_name_82 ( total INTEGER, tournament INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average total for tournament less than 0
SELECT AVG(total) FROM table_name_82 WHERE tournament < 0
sql_create_context
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE journal ( journalid int, journalname va...
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, keyphrase, paperkeyphrase, writes WHERE author.authorname = 'Ed Desmond' AND keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid
scholar
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17667 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
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.insurance = "Medicaid" AND procedures.icd9_code = "403"
mimicsql_data
CREATE TABLE table_1502 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Eagles points" real, "Opponents" real, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What record was reached when the Eagle...
SELECT "Record" FROM table_1502 WHERE "Opponent" = 'Phoenix Cardinals'
wikisql
CREATE TABLE table_name_23 ( july VARCHAR, annual_precipitation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the July temperature where the annual precipitation is 514mm (20.2in)?
SELECT july FROM table_name_23 WHERE annual_precipitation = "514mm (20.2in)"
sql_create_context
CREATE TABLE table_76222 ( "Date" text, "Opponent" text, "Score" text, "Leading Scorer" text, "Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the leading scorer of the wnba finals series?
SELECT "Leading Scorer" FROM table_76222 WHERE "Series" = 'wnba finals'
wikisql
CREATE TABLE table_name_59 ( overall INTEGER, college VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the overall number for Louisiana Tech college, and a pick more than 10?
SELECT SUM(overall) FROM table_name_59 WHERE college = "louisiana tech" AND pick__number > 10
sql_create_context
CREATE TABLE table_2305948_1 ( other_placings VARCHAR, federation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times has a wrestler whose federation was roh, wwe competed in this event?
SELECT COUNT(other_placings) FROM table_2305948_1 WHERE federation = "ROH, WWE"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) ...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'thoracic aortic an...
mimic_iii
CREATE TABLE table_17375 ( "Finish" real, "Start" real, "Car No." real, "Driver" text, "Car Name" text, "Car Make" text, "Entrant" text, "Laps" real, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status of joe g...
SELECT "Status" FROM table_17375 WHERE "Entrant" = 'Joe Gibbs Racing'
wikisql
CREATE TABLE table_29296103_10 ( tournament VARCHAR, runner_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament was runner-up paul annacone eric korita?
SELECT tournament FROM table_29296103_10 WHERE runner_up = "Paul Annacone Eric Korita"
sql_create_context
CREATE TABLE table_12570207_1 ( rockhampton INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the minimum rockhampton
SELECT MIN(rockhampton) FROM table_12570207_1
sql_create_context
CREATE TABLE tweets ( id bigint(20), uid int(11), text char(140), createdate datetime ) CREATE TABLE follows ( f1 int(11), f2 int(11) ) CREATE TABLE user_profiles ( uid int(11), name varchar(255), email varchar(255), partitionid int(11), followers int(11) ) -- Using valid...
SELECT name, COUNT(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_1307572_1 ( first_minting VARCHAR, mass VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the coin with the mass of 3.7 g first minted?
SELECT first_minting FROM table_1307572_1 WHERE mass = "3.7 g"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT demographic.days_stay FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.JZZDSM = '嗜眠症' GROUP BY person_info.JGDM UNION SELECT per...
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Vancomycin"
mimicsql_data
CREATE TABLE table_48300 ( "Outcome" text, "Date" text, "Location" text, "Surface" text, "Opponent in final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Surface, when Date is 2 May 1999?
SELECT "Surface" FROM table_48300 WHERE "Date" = '2 may 1999'
wikisql
CREATE TABLE gwyjzb ( 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 gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '杨雅彤' AND gwyjzb.MED_SER_ORG_NO = '5908957' AND gwyjzb.OUT_DIAG_DOC_NM LIKE '水%' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '杨雅彤' AND fgwyjzb.MED_SER_ORG_NO = '5908957' AN...
css
CREATE TABLE table_70047 ( "Rank" real, "Mountain Peak" text, "Province" text, "Mountain Range" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the province with rank more than 49
SELECT "Province" FROM table_70047 WHERE "Rank" > '49'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_des...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN...
atis