instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE t...
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location DESC
nvbench
CREATE TABLE table_54216 ( "Character" text, "Position" text, "Actor" text, "First Episode" text, "Final Episode" text, "Duration" text, "Final Episode Count" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What actor plays glen cole?
SELECT "Actor" FROM table_54216 WHERE "Character" = 'glen cole'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '26537481' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 4534.41)
css
CREATE TABLE table_203_117 ( id number, "region/country" text, "1882-\n1918" number, "1919-\n1948" number, "1948-\n1951" number, "1952-\n1960" number, "1961-\n1971" number, "1972-\n1979" number, "1980-\n1989" number, "1990-\n2001" number, "2002-\n2010" number, "2011-\n201...
SELECT "region/country" FROM table_203_117 WHERE "region/country" = 'africa'
squall
CREATE TABLE table_58822 ( "Champion" text, "Score" text, "Runner-up" text, "Additional participants" text, "Host location(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Champion had a Score of 9 1?
SELECT "Champion" FROM table_58822 WHERE "Score" = '9–1'
wikisql
CREATE TABLE table_name_55 ( assembled VARCHAR, summoned VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Assembled, when Summoned is '6 October 1297'?
SELECT assembled FROM table_name_55 WHERE summoned = "6 october 1297"
sql_create_context
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )...
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 = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SALT L...
atis
CREATE TABLE table_name_8 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Opponent that has the Record of 7-7-1?
SELECT opponent FROM table_name_8 WHERE record = "7-7-1"
sql_create_context
CREATE TABLE table_11850 ( "Tournament" text, "Winner" text, "Runner-up" text, "Score" text, "Third Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Runner-up in Tournament of seiersberg
SELECT "Runner-up" FROM table_11850 WHERE "Tournament" = 'seiersberg'
wikisql
CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2), end_min numeric(2) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) CREATE TABLE takes ( ID varchar(5),...
SELECT title, COUNT(title) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY COUNT(title) DESC
nvbench
CREATE TABLE table_name_9 ( uk_base VARCHAR, troop_carrier_group VARCHAR, serial VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which UK base has 441st tcg Troop carrier group and 14 as their seir serial?
SELECT uk_base FROM table_name_9 WHERE troop_carrier_group = "441st tcg" AND serial = "14"
sql_create_context
CREATE TABLE table_62490 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the gold when silver is 1, rank is larger than 3, total is smaller than 2, bronze is smaller than 0?
SELECT SUM("Gold") FROM table_62490 WHERE "Silver" = '1' AND "Rank" > '3' AND "Total" < '2' AND "Bronze" < '0'
wikisql
CREATE TABLE table_21434618_1 ( team__number2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- give the 1st leg score against ilisiakos
SELECT 1 AS st_leg FROM table_21434618_1 WHERE team__number2 = "Ilisiakos"
sql_create_context
CREATE TABLE table_name_94 ( party VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which party is Madeleine Plamondon a member of?
SELECT party FROM table_name_94 WHERE name = "madeleine plamondon"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId...
SELECT S.BumpCount, MIN(S.FirstBump) AS EarliestBump, MAX(S.LastBump) AS LatestBump FROM (SELECT P.Id, B.BumpCount, B.FirstBump, B.LastBump, P.Title FROM Posts AS P JOIN (SELECT H.PostId, COUNT(*) AS BumpCount, MIN(H.CreationDate) AS FirstBump, MAX(H.CreationDate) AS LastBump FROM PostHistory AS H WHERE PostHistoryType...
sede
CREATE TABLE table_1132588_3 ( fastest_lap VARCHAR, grand_prix VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fastest lap for the european grand prix?
SELECT fastest_lap FROM table_1132588_3 WHERE grand_prix = "European grand_prix"
sql_create_context
CREATE TABLE table_14368 ( "Title" text, "Year" real, "Platform" text, "Developer" text, "Publisher" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the plaform for year more than 2006 and developer of 3g studios
SELECT "Platform" FROM table_14368 WHERE "Year" > '2006' AND "Developer" = '3g studios'
wikisql
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2111" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_name_4 ( name VARCHAR, order VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which name had an order number of 1?
SELECT name FROM table_name_4 WHERE order = 1
sql_create_context
CREATE TABLE table_59927 ( "White" text, "Black" text, "Year" real, "Result" text, "Moves" real, "Tournament" text, "Opening" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the result when there's more than 41 moves with an opening of...
SELECT "Result" FROM table_59927 WHERE "Moves" > '41' AND "Year" = '2007' AND "Opening" = 'c42 petrov''s defence'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, ...
SELECT Id, PostTypeId, AcceptedAnswerId, ParentId, CreationDate, OwnerUserId, Tags FROM Posts
sede
CREATE TABLE table_name_53 ( season VARCHAR, wins VARCHAR, loses VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seasons have Losses larger than 1, and a Competition of fiba europe cup, and Wins smaller than 4?
SELECT COUNT(season) FROM table_name_53 WHERE loses > 1 AND competition = "fiba europe cup" AND wins < 4
sql_create_context
CREATE TABLE table_name_82 ( runs VARCHAR, inns INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of runs for the player with fewer than 9 Inns?
SELECT COUNT(runs) FROM table_name_82 WHERE inns < 9
sql_create_context
CREATE TABLE table_name_56 ( loss VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Loss is recorded for the Date June 2?
SELECT loss FROM table_name_56 WHERE date = "june 2"
sql_create_context
CREATE TABLE table_204_430 ( id number, "model" text, "origin" text, "type" text, "version" text, "in service" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the first model on the list ?
SELECT "model" FROM table_204_430 WHERE id = 1
squall
CREATE TABLE table_6278 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average week with St. Louis Cardinals with less than 80,010 attendance?
SELECT AVG("Week") FROM table_6278 WHERE "Opponent" = 'st. louis cardinals' AND "Attendance" < '80,010'
wikisql
CREATE TABLE table_74364 ( "Sl. No." real, "Train number" real, "Train name" text, "Origin" text, "Destination" text, "Time" text, "Service" text, "Route/Via." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the destination when t...
SELECT "Destination" FROM table_74364 WHERE "Train number" = '16526'
wikisql
CREATE TABLE table_53232 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On the date of April 22, which city was a visitor?
SELECT "Visitor" FROM table_53232 WHERE "Date" = 'april 22'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8629605' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM
css
CREATE TABLE manager ( manager_id number, name text, country text, working_year_starts text, age number, level number ) CREATE TABLE railway ( railway_id number, railway text, builder text, built text, wheels text, location text, objectnumber text ) CREATE TABLE tra...
SELECT country FROM manager WHERE age > 50 OR age < 46
spider
CREATE TABLE table_1934 ( "Country" text, "Contestant" text, "Age" real, "Height (cm)" real, "Height (ft)" text, "Hometown" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When johannesburg is the hometown who is the contestant?
SELECT "Contestant" FROM table_1934 WHERE "Hometown" = 'Johannesburg'
wikisql
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT mzjzjlb.JZLSH 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 NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2013-05-19')
css
CREATE TABLE Events ( Event_ID INTEGER, Address_ID INTEGER, Channel_ID INTEGER, Event_Type_Code CHAR(15), Finance_ID INTEGER, Location_ID INTEGER ) CREATE TABLE Parties ( Party_ID INTEGER, Party_Details VARCHAR(255) ) CREATE TABLE Agreements ( Document_ID INTEGER, Event_ID INTE...
SELECT Product_Type_Code, COUNT(Product_Type_Code) FROM Products GROUP BY Product_Type_Code ORDER BY Product_Type_Code
nvbench
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE trip ( id INTEGER, d...
SELECT start_station_name, start_station_id FROM trip ORDER BY start_station_id DESC
nvbench
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.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '05238824503'
css
CREATE TABLE table_name_77 ( december INTEGER, points VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which December has Points of 48, and a Game larger than 33?
SELECT SUM(december) FROM table_name_77 WHERE points = 48 AND game > 33
sql_create_context
CREATE TABLE table_204_693 ( id number, "place" text, "total" number, "men" number, "women" number, "children" number, "elderly" number, "serbs" number, "jews" number, "romani" number, "rusyns" number, "hungarians" number, "russians" number ) -- Using valid SQLite, ...
SELECT "place" FROM table_204_693 ORDER BY "total" LIMIT 1
squall
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.PERSON_ID = '88637428' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-02-02' AND '2019-04-19'
css
CREATE TABLE table_23286158_8 ( high_points VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the high points for 30-23
SELECT high_points FROM table_23286158_8 WHERE record = "30-23"
sql_create_context
CREATE TABLE table_53060 ( "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 home team score that played at Kardi...
SELECT "Home team score" FROM table_53060 WHERE "Venue" = 'kardinia park'
wikisql
CREATE TABLE table_name_14 ( wickets INTEGER, best_bowling VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest wickets when best bowling is 5/40 and average is less than 33.09?
SELECT MAX(wickets) FROM table_name_14 WHERE best_bowling = "5/40" AND average < 33.09
sql_create_context
CREATE TABLE table_204_742 ( id number, "release date" text, "single title" text, "uk singles chart\nposition" number, "french\ncharts" number, "german\ncharts" number, "irish\ncharts" number, "various" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT MIN("release date") FROM table_204_742
squall
CREATE TABLE table_train_96 ( "id" int, "gender" string, "elevated_creatinine" float, "diabetic" string, "cerebrovascular_disease" bool, "moca_score" int, "parkinsonism" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- eleva...
SELECT * FROM table_train_96 WHERE (elevated_creatinine > 1.3 AND gender = 'female') OR (elevated_creatinine > 1.4 AND gender = 'male')
criteria2sql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE l...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'wbc x 1000'...
eicu
CREATE TABLE table_45451 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the place when the score is 70-72=142?
SELECT "Place" FROM table_45451 WHERE "Score" = '70-72=142'
wikisql
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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, X...
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSMC = '中医推拿科' AND zyjzjlb.RYDJSJ BETWEEN '2004-10-25' AND '2011-05-02'
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( med...
SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006...
eicu
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "NU"
mimicsql_data
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT MIN(Posts.CreationDate), (COUNT(*) + 0.0) / TIME_TO_STR(LAST_DATE_OF_MONTH(MIN(Posts.CreationDate)), '%d') AS "posts per day" FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId WHERE (Tags.TagName = 'rust' OR Tags.TagName = 'c++') AND Posts.CreationDate > '20...
sede
CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, ...
SELECT Position, AVG(Points) FROM player GROUP BY Position
nvbench
CREATE TABLE table_68373 ( "Nationality" text, "Position" text, "Leeds career" text, "Appearances" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of goals for a player who had a Leeds career from 1960 1964 an...
SELECT AVG("Goals") FROM table_68373 WHERE "Leeds career" = '1960–1964' AND "Appearances" < '120'
wikisql
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.age < "64" AND demographic.days_stay > "11"
mimicsql_data
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.short_title = "Percu endosc jejunostomy"
mimicsql_data
CREATE TABLE table_name_38 ( october INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which October is the lowest one that has an Opponent of washington capitals?
SELECT MIN(october) FROM table_name_38 WHERE opponent = "washington capitals"
sql_create_context
CREATE TABLE table_7501 ( "Name" text, "Date of Birth" text, "Height" real, "Weight" real, "Spike" real, "Block" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Spike when the Weight was more than 84, and Block was less than 31...
SELECT SUM("Spike") FROM table_7501 WHERE "Weight" > '84' AND "Block" < '315'
wikisql
CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE management ( department_ID int, head_ID int, tempor...
SELECT Name, Budget_in_Billions FROM department ORDER BY Budget_in_Billions DESC
nvbench
CREATE TABLE table_name_87 ( year VARCHAR, english_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- English title of am lie had what year?
SELECT year FROM table_name_87 WHERE english_title = "amélie"
sql_create_context
CREATE TABLE table_73213 ( "Shareholder" text, "s A share" real, "s B share" real, "Percent of capital" text, "Percent of votes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the s B share for the shareholder that has 2.55 percent of votes?...
SELECT MAX("s B share") FROM table_73213 WHERE "Percent of votes" = '2.55'
wikisql
CREATE TABLE table_39845 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Italy's highest total when there were less than 4 bronze and 1 gold?
SELECT MAX("Total") FROM table_39845 WHERE "Bronze" < '4' AND "Gold" = '1' AND "Nation" = 'italy'
wikisql
CREATE TABLE table_name_34 ( competition VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Competition had a Result of lost 1-2?
SELECT competition FROM table_name_34 WHERE result = "lost 1-2"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count ...
SELECT p.LastEditDate AS "edit_date", p.Id AS "post_link", c.Text AS Comment FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id WHERE c.UserId = '##UserId##' AND c.CreationDate < p.LastEditDate ORDER BY p.LastEditDate DESC
sede
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 DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
sede
CREATE TABLE table_name_11 ( wnba_game_average INTEGER, average VARCHAR, total_for_year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest WNBA game average with 9,290 (4th) is the average, and less than 157,934 is the total for the year?...
SELECT MAX(wnba_game_average) FROM table_name_11 WHERE average = "9,290 (4th)" AND total_for_year < 157 OFFSET 934
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
SELECT DATEADD(m, MONTH(Date), '2010-12-01') AS "month", COUNT(Id) AS "supporter" FROM Badges WHERE YEAR(Date) = 2011 AND Name = 'Supporter' GROUP BY MONTH(Date) ORDER BY MONTH(Date)
sede
CREATE TABLE table_name_18 ( year VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of years for a 39-31 record
SELECT COUNT(year) FROM table_name_18 WHERE record = "39-31"
sql_create_context
CREATE TABLE table_8113 ( "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 is the college for keenan robinson when overall is more than 102?
SELECT "College" FROM table_8113 WHERE "Overall" > '102' AND "Name" = 'keenan robinson'
wikisql
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '9719119' AND qtb.MED_ORG_DEPT_CD = '9117' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '9719119' AND gyb.MED_ORG_DEPT_CD = '9117' UNION SELECT zyb.MED_CLINIC_ID FRO...
css
CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real ) CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text ) -- Using valid SQLite, answer the ...
SELECT Date, Vote_Percent FROM election ORDER BY Vote_Percent DESC
nvbench
CREATE TABLE table_33652 ( "Rank" real, "All-time Rank" text, "Name" text, "Debut Year" real, "Current Club" text, "Apps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the current club with more than 368 apps and a debut year earlier th...
SELECT "Current Club" FROM table_33652 WHERE "Apps" > '368' AND "Debut Year" < '1994'
wikisql
CREATE TABLE table_204_863 ( id number, "state" text, "city/county" text, "population served" number, "charter type" text, "station name" text, "web site" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many are charter type g ?
SELECT COUNT(*) FROM table_204_863 WHERE "charter type" = 'g'
squall
CREATE TABLE table_12584173_1 ( population__stanthorpe_ INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum population size in the town of Stanthorpe?
SELECT MAX(population__stanthorpe_) FROM table_12584173_1
sql_create_context
CREATE TABLE table_22811 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT MIN("Starts") FROM table_22811 WHERE "Avg. Finish" = '19.3'
wikisql
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 cost ( c...
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-161415' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL O...
eicu
CREATE TABLE table_name_6 ( away_team VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the away team for tie number 9?
SELECT away_team FROM table_name_6 WHERE tie_no = "9"
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "EPISCOPALIAN"
mimicsql_data
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 WHERE demographic.age < "31" AND demographic.days_stay > "2"
mimicsql_data
CREATE TABLE table_name_49 ( college VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the College with a Player that is dean caliguire?
SELECT college FROM table_name_49 WHERE player = "dean caliguire"
sql_create_context
CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) ...
SELECT Season, COUNT(Season) FROM game GROUP BY Season ORDER BY Season DESC
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "IV"
mimicsql_data
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_SEX = '尤幼仪' AND t_kc22.STA_DATE BETWEEN '2020-09-13' AND '2021-01-21' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_65 ( player VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player has a t57 as the finish?
SELECT player FROM table_name_65 WHERE finish = "t57"
sql_create_context
CREATE TABLE table_name_54 ( l2_cache VARCHAR, model_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is L2 Cache, when Model Number is Pentium II 350?
SELECT l2_cache FROM table_name_54 WHERE model_number = "pentium ii 350"
sql_create_context
CREATE TABLE table_786 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Cordell Hull is the incumbent in how many districts?
SELECT COUNT("District") FROM table_786 WHERE "Incumbent" = 'Cordell Hull'
wikisql
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.gender = "F" AND demographic.insurance = "Government"
mimicsql_data
CREATE TABLE table_30121096_1 ( poor_law_union VARCHAR, area__acres__ VARCHAR, civil_parish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many poor law unions have an area of 262 acres and is in drinagh civil parish?
SELECT COUNT(poor_law_union) FROM table_30121096_1 WHERE area__acres__ = 262 AND civil_parish = "Drinagh"
sql_create_context
CREATE TABLE Products ( Name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Select the names of all the products in the store.
SELECT Name FROM Products
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodici...
SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-149724') AND patient.unitdischargetime IS N...
eicu
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 demographic ( subject_id text, hadm_id t...
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 = "Docusate Sodium"
mimicsql_data
CREATE TABLE table_3444 ( "Actor/Actress" text, "Character" text, "First Appearance" text, "Last Appearance" text, "Duration" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many characters where actor/actress is larry lamb?
SELECT COUNT("Character") FROM table_3444 WHERE "Actor/Actress" = 'Larry Lamb'
wikisql
CREATE TABLE table_74845 ( "Name" text, "Status" text, "Population" real, "District" text, "Former local authority" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the district of wallasey
SELECT "District" FROM table_74845 WHERE "Name" = 'wallasey'
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, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id...
advising
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedA...
WITH counts_cte AS (SELECT SUM(UpVotes) AS countall, SUM(CASE WHEN (Reputation = 101) THEN UpVotes ELSE 0 END) AS countlow FROM Users) SELECT countlow AS "Upvotes from low rep users", countall AS "Total upvotes", ROUND((CAST(countlow AS FLOAT)) * 100.0 / (CAST(countall AS FLOAT)), 3) AS percentage FROM counts_cte
sede
CREATE TABLE table_67492 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the venue for 2004 and position of 25th
SELECT "Venue" FROM table_67492 WHERE "Position" = '25th' AND "Year" = '2004'
wikisql
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.expire_flag = "1" AND demographic.days_stay > "6"
mimicsql_data
CREATE TABLE table_75856 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Time with a Score that is 80-34?
SELECT "Time" FROM table_75856 WHERE "Score" = '80-34'
wikisql
CREATE TABLE table_203_69 ( id number, "representative" text, "title" text, "from" number, "to" number, "appointed by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- count the number of special diplomatic agents and give that number .
SELECT COUNT(*) FROM table_203_69 WHERE "title" = 'special diplomatic agent'
squall
CREATE TABLE table_28138035_4 ( womens_singles VARCHAR, year_location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of womens singles for 1999 rio de janeiro
SELECT COUNT(womens_singles) FROM table_28138035_4 WHERE year_location = "1999 Rio de Janeiro"
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 demographic.name, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_8681 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT COUNT("Goals against") FROM table_8681 WHERE "Position" > '1' AND "Played" > '10'
wikisql
CREATE TABLE table_name_86 ( year VARCHAR, team VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years did Team Newman/Haas Racing receive a 1st place ranking?
SELECT COUNT(year) FROM table_name_86 WHERE team = "newman/haas racing" AND rank = "1st"
sql_create_context