instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number...
SELECT c.PostId AS "post_link", c.CreationDate, c.Text FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id WHERE c.Text LIKE '%solved your problem%' AND c.UserId = '##UserId:Int?117549##' AND NOT p.AcceptedAnswerId IS NULL ORDER BY c.CreationDate DESC
sede
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flig...
SELECT DISTINCT booking_class FROM class_of_service
atis
CREATE TABLE table_43195 ( "Team" text, "Match" real, "Points" real, "Draw" real, "Lost" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which average draw has points greater than 12?
SELECT AVG("Draw") FROM table_43195 WHERE "Points" > '12'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "72" AND prescriptions.drug = "Collagenase Ointment"
mimicsql_data
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT demographic.discharge_location, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "74032"
mimicsql_data
CREATE TABLE table_204_467 ( id number, "date" text, "opponents" text, "h/a" text, "result\nf-a" text, "scorers" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which game had the largest attendance ?
SELECT "date" FROM table_204_467 ORDER BY "attendance" DESC LIMIT 1
squall
CREATE TABLE table_72941 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original U.S. air date" text, "Prod. code" real, "Viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "Directed by" FROM table_72941 WHERE "Title" = 'Twister: Part 1'
wikisql
CREATE TABLE table_name_75 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2010 value with a 1r in 2012 and an A in 2005?
SELECT 2010 FROM table_name_75 WHERE 2012 = "1r" AND 2005 = "a"
sql_create_context
CREATE TABLE table_66826 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Venue on 26 jan 2005
SELECT "Venue" FROM table_66826 WHERE "Date" = '26 jan 2005'
wikisql
CREATE TABLE college ( college_id number, name text, leader_name text, college_location text ) CREATE TABLE member ( member_id number, name text, country text, college_id number ) CREATE TABLE round ( round_id number, member_id number, decoration_theme text, rank_in_rou...
SELECT T2.name, T1.college_location FROM college AS T1 JOIN member AS T2 ON T1.college_id = T2.college_id ORDER BY T2.name
spider
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '55185411' AND t_kc22.STA_DATE BETWEEN '2003-04-12' AND '2008-09-25' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE sta...
SELECT Number_of_matches, COUNT(Number_of_matches) FROM injury_accident WHERE Injury <> 'Knee problem' GROUP BY Number_of_matches ORDER BY Number_of_matches DESC
nvbench
CREATE TABLE table_13712 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" real, "League Cup Goals" real, "Total Apps" text, "Total Goals" real ) -- Using valid SQLite, answer the following questi...
SELECT AVG("Total Goals") FROM table_13712 WHERE "FA Cup Goals" = '0' AND "FA Cup Apps" = '3' AND "Position" = 'fw'
wikisql
CREATE TABLE table_334 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which players were number 3?
SELECT "Player" FROM table_334 WHERE "No.(s)" = '3'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '75340002' AND t_kc22.STA_DATE BETWEEN '2004-08-08' AND '2019-09-03' AND t_kc22.SELF_PAY_AMO > 8808.11
css
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE EMPLOYEE...
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE
nvbench
CREATE TABLE table_name_62 ( record VARCHAR, round VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Record has a Round larger than 2, and an Event of bellator 38?
SELECT record FROM table_name_62 WHERE round > 2 AND event = "bellator 38"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%uruguay%' ORDER BY Reputation DESC
sede
CREATE TABLE table_619 ( "Ensemble" text, "Gold Medals" real, "Silver Medals" real, "Bronze Medals" real, "Total Medals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many gold medals does each school who has a total of 1 medal have?
SELECT "Gold Medals" FROM table_619 WHERE "Total Medals" = '1'
wikisql
CREATE TABLE greatermanchestercrime ( crimeid text, crimets time, location text, lsoa text, type text, outcome text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the safest area?
SELECT location FROM greatermanchestercrime GROUP BY location ORDER BY COUNT(*) LIMIT 1
greatermanchestercrime
CREATE TABLE table_name_67 ( name VARCHAR, took_office VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has Took Office of march 4, 1875?
SELECT name FROM table_name_67 WHERE took_office = "march 4, 1875"
sql_create_context
CREATE TABLE table_60806 ( "Rank" real, "Res." text, "Wind" text, "Athlete" text, "Date" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the wind at New York City when the rank was smaller than 6?
SELECT "Wind" FROM table_60806 WHERE "Rank" < '6' AND "Location" = 'new york city'
wikisql
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No...
SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name
nvbench
CREATE TABLE table_3726 ( "#" real, "Matches As Captain" text, "Player" text, "Asian Cup Played As A Captain" text, "Years Active" text, "Caps(Goals)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of years active listin...
SELECT COUNT("Years Active") FROM table_3726 WHERE "Asian Cup Played As A Captain" = 'Japan 1992'
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 jyjgzbb ( JYZBLSH text, YLJGD...
SELECT SG, TZ, TW, SSY, SZY, XL, HXPLC, ML FROM mzjzjlb WHERE JZLSH = '11382760786'
css
CREATE TABLE table_name_41 ( club VARCHAR, bowling_style VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club is R. H. C. Human who has a right arm medium pace bowling style a member of?
SELECT club FROM table_name_41 WHERE bowling_style = "right arm medium pace" AND name = "r. h. c. human"
sql_create_context
CREATE TABLE table_28959 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "Writer(s)" FROM table_28959 WHERE "No. in series" = '46'
wikisql
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 25 AND date_day.month_number = 6 AND da...
atis
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '98665662783' AND t_kc22.HOSP_DOC_NM LIKE '蒋%'
css
CREATE TABLE table_name_77 ( position VARCHAR, year_born__age_ VARCHAR, current_club VARCHAR, height VARCHAR ) -- 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 whose ear bo...
SELECT position FROM table_name_77 WHERE current_club = "alba berlin" AND height > 1.96 AND year_born__age_ = "july 23, 1985 (age28)"
sql_create_context
CREATE TABLE subjects ( subject_id number, subject_name text ) CREATE TABLE students ( student_id number, date_of_registration time, date_of_latest_logon time, login_name text, password text, personal_name text, middle_name text, family_name text ) CREATE TABLE student_tests_ta...
SELECT T1.student_id, T2.personal_name FROM student_course_enrolment AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2
spider
CREATE TABLE table_204_498 ( id number, "location" text, "building" text, "year" number, "km" number, "monument" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what km comes after 8.25 , but before
SELECT "km" FROM table_204_498 WHERE id = (SELECT id FROM table_204_498 WHERE "km" = 8.25) + 1
squall
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "NEWBORN"
mimicsql_data
CREATE TABLE table_45023 ( "Antibody" text, "Brand name" text, "Approval date" real, "Type" text, "Target" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the type for the brand herceptin with an approval date of before 2006?
SELECT "Type" FROM table_45023 WHERE "Approval date" < '2006' AND "Brand name" = 'herceptin'
wikisql
CREATE TABLE table_1886270_1 ( built VARCHAR, hr_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When (river garry) is the hr name how many builts are there?
SELECT COUNT(built) FROM table_1886270_1 WHERE hr_name = "(River Garry)"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "85" AND lab.label = "Other Cells"
mimicsql_data
CREATE TABLE table_18737 ( "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. -- Which district was the race between john i. nolan (r) 87% thomas f. feel...
SELECT "District" FROM table_18737 WHERE "Candidates" = 'John I. Nolan (R) 87% Thomas F. Feeley (S) 13%'
wikisql
CREATE TABLE table_27086613_5 ( league_apps INTEGER, total_apps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least league apps for total apps of 5
SELECT MIN(league_apps) FROM table_27086613_5 WHERE total_apps = 5
sql_create_context
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_20...
SELECT meter_700, meter_100 FROM swimmer
nvbench
CREATE TABLE table_3825 ( "Season" text, "Competition" text, "Stage" text, "Result" text, "Opponent" text, "Scorers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent in the Women's Cup 0 0 where Branc o Couto 0 is the scorer?
SELECT "Opponent" FROM table_3825 WHERE "Competition" = 'Women''s Cup 0 0' AND "Scorers" = 'Brancão Couto 0'
wikisql
CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), time_slot_id varchar(4) ) CREATE TABLE classroom ( building varchar(15...
SELECT T1.dept_name, COUNT(DISTINCT T3.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY COUNT(DISTINCT T3.ID) DESC
nvbench
CREATE TABLE table_413 ( "Jurisdiction" text, "Voted Yes" real, "Percent Yes" text, "Voted No" real, "Percent No" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the percent yes where voted yes is 2410119
SELECT "Percent Yes" FROM table_413 WHERE "Voted Yes" = '2410119'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT Users.Id AS "user_link", COUNT(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_answer_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, DisplayName HAVING COUNT(Posts.Id) > '#...
sede
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 ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%kolkata%' OR UPPER(Location) LIKE '%KOLKATA%' OR Location LIKE '%kolkata%' ORDER BY Reputation DESC LIMIT 5
sede
CREATE TABLE table_26731 ( "Season" text, "Champions" text, "Runner-up" text, "Third Place" text, "Top Goalscorer" text, "Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the top goalscorer for season 2001-02?
SELECT "Top Goalscorer" FROM table_26731 WHERE "Season" = '2001-02'
wikisql
CREATE TABLE table_204_489 ( id number, "rank" number, "name" text, "height" text, "floors" number, "year" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of floors of the oldest building ?
SELECT "floors" FROM table_204_489 ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_78134 ( "Tallangatta DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the fewest draws with less than 7 losses and Mitta United is the Tallagat...
SELECT MIN("Draws") FROM table_78134 WHERE "Losses" < '7' AND "Tallangatta DFL" = 'mitta united'
wikisql
CREATE TABLE table_46837 ( "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 g...
SELECT COUNT("Game") FROM table_46837 WHERE "Team" = 'minnesota'
wikisql
CREATE TABLE table_name_21 ( home_team VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE HOME TEAM WITH A TIE OF 14?
SELECT home_team FROM table_name_21 WHERE tie_no = "14"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subje...
SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'lisinopril' AND admissions.subject_id = 14990 AND STRFTIME('%y-%m', prescriptions.startdate) = '2104-10') AS t1 JOIN (SELECT admiss...
mimic_iii
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) -- Using valid SQLite, answer the following questions for the tables provided above. -- A bar...
SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY name DESC
nvbench
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE c...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86792) AND STRFTIME('%y', prescriptions.startdate) >= '2101'
mimic_iii
CREATE TABLE table_8286 ( "Player" text, "PL Apps" real, "PL G" real, "CL Apps" real, "CL G" real, "FAC / LC Apps" real, "FAC / LC G" real, "Total Apps" real, "Total G" real, "FA YC" real, "UEFA YC" real ) -- Using valid SQLite, answer the following questions for the tables...
SELECT SUM("FAC / LC Apps") FROM table_8286 WHERE "PL Apps" < '25' AND "UEFA YC" < '0'
wikisql
CREATE TABLE table_name_63 ( opposing_teams VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opposing teams playing on 11/04/1999?
SELECT opposing_teams FROM table_name_63 WHERE date = "11/04/1999"
sql_create_context
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 MIN(t_kc24.MED_AMOUT), MAX(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 = '3153932' AND qtb.IN_DIAG_DIS_CD = 'C22.756' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '3153932' AND gyb.IN_DIAG_DIS_CD = 'C22.756' UNION S...
css
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CR...
SELECT COUNT(*) AS count FROM Posts WHERE PostTypeId = 2
sede
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MAIN_COND_DES FROM t_kc21 WHERE MED_CLINIC_ID = '12288488200'
css
CREATE TABLE table_train_105 ( "id" int, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "hypertension" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions...
SELECT * FROM table_train_105 WHERE age < 50 OR age > 90
criteria2sql
CREATE TABLE table_77518 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average losses when the wins is 3?
SELECT AVG("Losses") FROM table_77518 WHERE "Wins" = '3'
wikisql
CREATE TABLE table_name_65 ( year VARCHAR, venue VARCHAR, winner VARCHAR, runner_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is the winner panathinaikos, the runner-up olympiacos and the venue nikos goumas stadium?
SELECT year FROM table_name_65 WHERE winner = "panathinaikos" AND runner_up = "olympiacos" AND venue = "nikos goumas stadium"
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "17"
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '2084494' AND mzjzjlb.JZKSRQ BETWEEN '2001-06-03' AND '2019-07-02' AND mzjzjlb.ZSEBZ > 0
css
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId numb...
WITH numbers(v) AS (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) FROM (VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9)) AS n0(x)) SELECT ord = @n * (v + 2 * m) + n, n * (1 - v) + ABS(-@n - 1 + n) * v FROM (SELECT v FROM numbers ORDER BY v LIMIT @n) AS n(n) CROSS JOIN (VALUES (0), (1)) AS s(v) CROSS JOIN (SELECT...
sede
CREATE TABLE table_29747178_2 ( written_by VARCHAR, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the writer when the director is bob berlinger?
SELECT written_by FROM table_29747178_2 WHERE directed_by = "Bob Berlinger"
sql_create_context
CREATE TABLE table_204_108 ( id number, "typ" text, "construction time" text, "cylinders" text, "capacity" text, "power" text, "top speed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which typ has the most capacity ?
SELECT "typ" FROM table_204_108 ORDER BY "capacity" DESC LIMIT 1
squall
CREATE TABLE table_36383 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which segment a's Netflix is S05E22?
SELECT "Segment A" FROM table_36383 WHERE "Netflix" = 's05e22'
wikisql
CREATE TABLE table_name_45 ( qiangshu INTEGER, rank VARCHAR, jianshu VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Qiangshu lower than rank 4 and less than 9.22 Jianshu?
SELECT AVG(qiangshu) FROM table_name_45 WHERE rank > 4 AND jianshu < 9.22
sql_create_context
CREATE TABLE table_name_9 ( lost INTEGER, points_1 VARCHAR, goals_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum lost with points 1 more than 58 and 66 goals against?
SELECT MAX(lost) FROM table_name_9 WHERE points_1 > 58 AND goals_against = 66
sql_create_context
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostsWithDeleted ( Id number, PostTyp...
SELECT COUNT(*) FROM Users WHERE Reputation >= 15
sede
CREATE TABLE table_204_891 ( id number, "name" text, "hanzi" text, "population (2005)" number, "area (km2)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which division had the larger area ?
SELECT "name" FROM table_204_891 ORDER BY "area (km2)" DESC LIMIT 1
squall
CREATE TABLE table_name_91 ( played VARCHAR, goal_difference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Played, when Goal Difference is '+51'?
SELECT played FROM table_name_91 WHERE goal_difference = "+51"
sql_create_context
CREATE TABLE table_13869651_3 ( release_date VARCHAR, part_number_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When's the release date of the model with part number adh485biaa5do?
SELECT release_date FROM table_13869651_3 WHERE part_number_s_ = "ADH485BIAA5DO"
sql_create_context
CREATE TABLE table_72509 ( "Position" real, "Club (City/Town)" text, "Games Played" real, "W-L-D" text, "Goals For/Against" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the minimum games played with goals for/against bei...
SELECT MIN("Games Played") FROM table_72509 WHERE "Goals For/Against" = '7-5'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '24113912' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2013-05-12')
css
CREATE TABLE table_name_45 ( gold INTEGER, bronze VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Gold count if the Bronze is 4 and Silver is greater than 5?
SELECT MIN(gold) FROM table_name_45 WHERE bronze = 4 AND silver > 5
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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 ) CREATE TABLE pat...
SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26995)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temp...
mimic_iii
CREATE TABLE table_60492 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country had a t4 place and scored 66-73=139?
SELECT "Country" FROM table_60492 WHERE "Place" = 't4' AND "Score" = '66-73=139'
wikisql
CREATE TABLE table_23584 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players were drafted from laval?
SELECT COUNT("CFL Team") FROM table_23584 WHERE "College" = 'Laval'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '78964308' AND t_kc22.STA_DATE BETWEEN '2012-03-26' AND '2018-10-14' AND t_kc22.SELF_PAY_PRO < 0.65 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb...
css
CREATE TABLE table_65778 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Bronze has a Rank of 4, and a Gold smaller than 0?
SELECT MAX("Bronze") FROM table_65778 WHERE "Rank" = '4' AND "Gold" < '0'
wikisql
CREATE TABLE table_10732 ( "Number Range" text, "Introduced" text, "Builder" text, "Engine" text, "Seats" text, "Withdrawn" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine was introduced in 1935?
SELECT "Engine" FROM table_10732 WHERE "Introduced" = '1935'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL
mimic_iii
CREATE TABLE table_74762 ( "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 for Footscray?
SELECT "Home team score" FROM table_74762 WHERE "Home team" = 'footscray'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, N...
SELECT COUNT(*) FROM Users WHERE Reputation >= '##X?30000##'
sede
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "BLADDER CANCER/SDA"
mimicsql_data
CREATE TABLE ref_locations ( location_code text, location_name text, location_description text ) CREATE TABLE employees ( employee_id number, role_code text, employee_name text, gender_mfu text, date_of_birth time, other_details text ) CREATE TABLE documents_to_be_destroyed ( d...
SELECT location_code FROM document_locations GROUP BY location_code HAVING COUNT(*) >= 3
spider
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_26769_1 ( capital VARCHAR, population_density_per_km² VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the capital of the country with a population density per km of 15.6/km (/sqmi)?
SELECT capital FROM table_26769_1 WHERE population_density_per_km² = "15.6/km² (/sqmi)"
sql_create_context
CREATE TABLE table_name_99 ( date VARCHAR, label VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date had a 4ad label and a CD (reissue) format?
SELECT date FROM table_name_99 WHERE label = "4ad" AND format = "cd (reissue)"
sql_create_context
CREATE TABLE table_2416 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Midshipmen points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the result for 9-1 record
SELECT "Result" FROM table_2416 WHERE "Record" = '9-1'
wikisql
CREATE TABLE table_640 ( "Episode #" real, "Title" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Part 5" text, "Part 6" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the part 1 of the episode 'Anxiety' air?...
SELECT "Part 1" FROM table_640 WHERE "Title" = 'Anxiety'
wikisql
CREATE TABLE table_31917 ( "Pick #" real, "MLS team" text, "Player" text, "Position" text, "Affiliation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Chicago fire has a total of a total of how many #s?
SELECT COUNT("Pick #") FROM table_31917 WHERE "MLS team" = 'chicago fire'
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, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'PHILADELPHIA' AND flight.from_airport = airport_service.airport_code
atis
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm_amenity ( amenid ...
SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY AVG(T1.Age)
nvbench
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home
nvbench
CREATE TABLE table_62152 ( "Pick #" real, "Player" text, "Nationality" text, "Position" text, "NHL team" text, "Team from" text, "League from" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Nationality of s dert lje sk?
SELECT "Nationality" FROM table_62152 WHERE "Team from" = 'södertälje sk'
wikisql
CREATE TABLE table_name_24 ( attendance INTEGER, record VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the mean attendance number when the record is 12-4 and the average is less than 10,027?
SELECT AVG(attendance) FROM table_name_24 WHERE record = "12-4" AND average < 10 OFFSET 027
sql_create_context
CREATE TABLE table_name_5 ( season_1 VARCHAR, season_7 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Season 1 has a Season 7 of david chilton?
SELECT season_1 FROM table_name_5 WHERE season_7 = "david chilton"
sql_create_context
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.dob_year < "2065" AND procedures.short_title = "Skin closure NEC"
mimicsql_data
CREATE TABLE table_204_627 ( id number, "date" text, "opponent" text, "score" text, "top scorer (total points)" text, "venue (location)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in how many games did this team have more than 80 points ?
SELECT COUNT(*) FROM table_204_627 WHERE "score" > 80
squall