instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_95 ( conference_joined VARCHAR, previous_conference VARCHAR, mascot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Conference Joined has a Previous Conference of northwestern, and a Mascot of oilers?
SELECT conference_joined FROM table_name_95 WHERE previous_conference = "northwestern" AND mascot = "oilers"
sql_create_context
CREATE TABLE resultsdata15 ( sample_pk number, commod text, commtype text, lab text, pestcode text, testclass text, concen number, lod number, conunit text, confmethod text, confmethod2 text, annotate text, quantitate text, mean text, extract text, determi...
SELECT country FROM sampledata15 WHERE sample_pk = 6480 AND origin = 2
pesticide
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price)
nvbench
CREATE TABLE table_17204 ( "Round" real, "Overall" text, "Player" text, "Position" text, "Nationality" text, "Club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club team did JArrod Maidens play for?
SELECT "Club team" FROM table_17204 WHERE "Player" = 'Jarrod Maidens'
wikisql
CREATE TABLE table_15829930_5 ( matches INTEGER, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least matches for year 2008
SELECT MIN(matches) FROM table_15829930_5 WHERE year = 2008
sql_create_context
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_Road, Team_ID FROM basketball_match ORDER BY Team_ID
nvbench
CREATE TABLE table_15441 ( "Riding" text, "Province" text, "Candidate" text, "Votes" real, "Placement" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Placement when the Candidate is Jean-Patrick Berthiaume?
SELECT "Placement" FROM table_15441 WHERE "Candidate" = 'jean-patrick berthiaume'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Bod...
SELECT p.Id AS "post_link", a.Score, a.CreationDate FROM Posts AS a, Posts AS p WHERE a.OwnerUserId = '##UserId##' AND a.PostTypeId = 2 AND p.Id = a.ParentId AND p.AcceptedAnswerId != a.Id ORDER BY a.Score, a.CreationDate
sede
CREATE TABLE table_777 ( "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. -- How many winners were there in the race of 1922
SELECT COUNT("Incumbent") FROM table_777 WHERE "First elected" = '1922'
wikisql
CREATE TABLE table_15431251_1 ( title VARCHAR, no_in_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title for episode number 7 in the season?
SELECT COUNT(title) FROM table_15431251_1 WHERE no_in_season = 7
sql_create_context
CREATE TABLE table_72981 ( "Outcome" text, "Edition" real, "Round" text, "Opponent Team" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the opponent was Dominika Cibulkov...
SELECT "Score" FROM table_72981 WHERE "Opponent" = 'Dominika Cibulková'
wikisql
CREATE TABLE table_4876 ( "Place" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many goals scored against the opposing tea...
SELECT COUNT("Goals Against") FROM table_4876 WHERE "Lost" > '7' AND "Goals For" < '27' AND "Drawn" > '1'
wikisql
CREATE TABLE table_8435 ( "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 score for Billy Andrade?
SELECT "Score" FROM table_8435 WHERE "Player" = 'billy andrade'
wikisql
CREATE TABLE table_70544 ( "Production year" text, "2001" real, "2002" real, "2003" real, "2004" real, "2005" real, "2006" real, "2007" real, "2008" real, "2009" real, "2010" real, "2011" real ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT AVG("2002") FROM table_70544 WHERE "2010" < '5587' AND "Production year" = 'sunflower' AND "2007" > '546'
wikisql
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 gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3990035' GROUP BY gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3990035' GROUP BY fgwyjzb.OUT_DIAG_DIS_NM
css
CREATE TABLE table_27700530_15 ( high_points VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the most points and how many did they have on April 22?
SELECT high_points FROM table_27700530_15 WHERE date = "April 22"
sql_create_context
CREATE TABLE table_203_777 ( id number, "years" text, "building" text, "city" text, "height (ctbuh)" text, "floors" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which building held the record before the current holder ?
SELECT "building" FROM table_203_777 WHERE "years" < present_ref ORDER BY "years" DESC LIMIT 1
squall
CREATE TABLE table_name_1 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance of the game on July 26?
SELECT SUM(attendance) FROM table_name_1 WHERE date = "july 26"
sql_create_context
CREATE TABLE table_name_26 ( site VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the site for game of game 2
SELECT site FROM table_name_26 WHERE game = "game 2"
sql_create_context
CREATE TABLE table_dev_42 ( "id" int, "gender" string, "depression" bool, "familial_hypercholesterolemia" bool, "microalbuminuria" int, "renal_disease" bool, "diabetic" string, "estimated_glomerular_filtration_rate_egfr" int, "serum_creatinine" float, "fbg" int, "body_mass_in...
SELECT * FROM table_dev_42 WHERE microalbuminuria <= 300 OR ((gender = 'male' AND serum_creatinine < 1.5) OR (gender = 'female' AND serum_creatinine < 1.4)) AND estimated_glomerular_filtration_rate_egfr > 60
criteria2sql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_c...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.i...
mimic_iii
CREATE TABLE table_204_302 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many total medals did brazil received ?
SELECT "total" FROM table_204_302 WHERE "nation" = 'brazil'
squall
CREATE TABLE table_name_67 ( play VARCHAR, author VARCHAR, base VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What play has a base of Athens and was written by Aeschylus?
SELECT play FROM table_name_67 WHERE author = "aeschylus" AND base = "athens"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId num...
SELECT DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS Rank, Posts.OwnerUserId AS "user_link", Posts.OwnerUserId AS UserId, COUNT(*) AS Count FROM Posts, Votes WHERE Posts.Id = Votes.PostId AND Votes.VoteTypeId = 3 AND Posts.PostTypeId = 2 AND Posts.CommunityOwnedDate IS NULL AND Posts.OwnerUserId > 0 GROUP BY Posts.Owne...
sede
CREATE TABLE wedding ( church_id number, male_id number, female_id number, year number ) CREATE TABLE people ( people_id number, name text, country text, is_male text, age number ) CREATE TABLE church ( church_id number, name text, organized_by text, open_date numbe...
SELECT name FROM church ORDER BY open_date DESC
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '强迫性障碍' AND jyjgzbb.JCZBMC = 'D2聚体(肝素/EDTA)'
css
CREATE TABLE table_name_10 ( attendance INTEGER, week INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average attendance after week 16?
SELECT AVG(attendance) FROM table_name_10 WHERE week > 16
sql_create_context
CREATE TABLE injury_accident ( game_id VARCHAR, injury VARCHAR ) CREATE TABLE stadium ( name VARCHAR, id VARCHAR ) CREATE TABLE game ( season VARCHAR, stadium_id VARCHAR, id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which season...
SELECT T1.season, T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.injury = 'Foot injury' OR T3.injury = 'Knee problem'
sql_create_context
CREATE TABLE table_61959 ( "President" text, "Treasurer" text, "Secretary" text, "Social AO" text, "Academic AO" text, "Internal CO" text, "External CO" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Secretary has an Internal CO of isab...
SELECT "Secretary" FROM table_61959 WHERE "Internal CO" = 'isabel voets'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND procedures.long_title = "Incision of vessel, lower limb arteries"
mimicsql_data
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id nu...
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29540)
mimic_iii
CREATE TABLE ref_budget_codes ( budget_type_code text, budget_type_description text ) CREATE TABLE accounts ( account_id number, statement_id number, account_details text ) CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description tex...
SELECT document_id FROM documents_with_expenses WHERE budget_type_code = 'SF'
spider
CREATE TABLE Skills_Required_To_Fix ( skill_id VARCHAR ) CREATE TABLE Skills ( skill_id VARCHAR, skill_description VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which skill is used in fixing the most number of faults? List the skill id and description....
SELECT T1.skill_id, T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id = T2.skill_id GROUP BY T1.skill_id ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Posts ...
SELECT Id, DisplayName, Age, Reputation, CreationDate, LastAccessDate, 'http://stackoverflow.com/users/' + CAST(Id AS TEXT) AS Url FROM Users AS b WHERE (b.Age <= 18) ORDER BY b.Reputation, b.Age
sede
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT * FROM Posts WHERE Score > 1000
sede
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREA...
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, venue, writes WHERE paper.year = 2010 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(paper.paperid) DESC
scholar
CREATE TABLE table_25065 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Vacators were listed when the district was North Carolina 3rd?
SELECT COUNT("Vacator") FROM table_25065 WHERE "District" = 'North Carolina 3rd'
wikisql
CREATE TABLE table_73158 ( "School" text, "City / Town" text, "Website" text, "Size" real, "Principal" text, "Grades" text, "IDOE Profile" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Bloomington High School North?
SELECT "City / Town" FROM table_73158 WHERE "School" = 'Bloomington High School North'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport ( airport_code varchar, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE table_28140141_1 ( artist VARCHAR, show VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many artists were there for the show thoroughly modern millie?
SELECT COUNT(artist) FROM table_28140141_1 WHERE show = "Thoroughly Modern Millie"
sql_create_context
CREATE TABLE table_20849830_1 ( result VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game with the record of 3-1?
SELECT result FROM table_20849830_1 WHERE record = "3-1"
sql_create_context
CREATE TABLE table_name_28 ( player VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player scored 76-68=144?
SELECT player FROM table_name_28 WHERE score = 76 - 68 = 144
sql_create_context
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 COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '奚美丽' AND t_kc22.STA_DATE BETWEEN '2008-11-27' AND '2019-02-21' AND gwyjzb.MED_SER_ORG_NO = '4566860' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "SINGLE" AND prescriptions.route = "DIALYS"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" AND demographic.admityear >= "2146"
mimicsql_data
CREATE TABLE table_46830 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Record that has the Game of 19?
SELECT "Record" FROM table_46830 WHERE "Game" = '19'
wikisql
CREATE TABLE table_name_75 ( class VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the class of the HMS Heartsease?
SELECT class FROM table_name_75 WHERE name = "hms heartsease"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "3613"
mimicsql_data
CREATE TABLE table_61774 ( "Year [e ] (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Main Language(s)" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the original title fo...
SELECT "Original title" FROM table_61774 WHERE "Film title used in nomination" = 'street days'
wikisql
CREATE TABLE table_name_58 ( points_against VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Points against for the ystradgynlais rfc club?
SELECT points_against FROM table_name_58 WHERE club = "ystradgynlais rfc"
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, SUM(Weight) FROM people GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE table_name_55 ( round VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round has a Name of john goodyear?
SELECT round FROM table_name_55 WHERE name = "john goodyear"
sql_create_context
CREATE TABLE table_name_22 ( birth VARCHAR, ceased_to_be_duke_of_girona VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE BIRTH DATE THAT HAS Ceased to be Duke of Girona OF 21 NOVEMBER 1582?
SELECT birth FROM table_name_22 WHERE ceased_to_be_duke_of_girona = "21 november 1582"
sql_create_context
CREATE TABLE table_name_37 ( italian VARCHAR, french VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the italian word for the french word 'mer
SELECT italian FROM table_name_37 WHERE french = "mer"
sql_create_context
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 COUNT(DISTINCT IN_DIAG_DIS_CD) FROM t_kc21 WHERE PERSON_NM = '孔岚翠' AND IN_HOSP_DATE BETWEEN '2010-04-05' AND '2013-04-09'
css
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION v...
SELECT DEPT_CODE, COUNT(*) FROM PROFESSOR WHERE PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY DEPT_CODE ORDER BY COUNT(*)
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT demographic.admittime, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "22377"
mimicsql_data
CREATE TABLE table_11951237_3 ( season__number INTEGER, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the season # where production code is k1505?
SELECT MIN(season__number) FROM table_11951237_3 WHERE production_code = "K1505"
sql_create_context
CREATE TABLE table_name_13 ( nationality VARCHAR, ranking VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nationality has a ranking less than 7 with tony stenson as the name?
SELECT nationality FROM table_name_13 WHERE ranking < 7 AND name = "tony stenson"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT demographic.dischtime, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "65759"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "1" AND procedures.short_title = "Hemodialysis"
mimicsql_data
CREATE TABLE table_55647 ( "Player" text, "Pos." text, "From" real, "School/Country" text, "Rebs" real, "Asts" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year a SG has over 650 assists?
SELECT MIN("From") FROM table_55647 WHERE "Pos." = 'sg' AND "Asts" > '650'
wikisql
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 mzjzjlb_jybgb ( YLJGDM_MZJZJLB te...
SELECT mzjzjlb.YLJGDM 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 = '62748683' UNION SELECT zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX ...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN"
mimicsql_data
CREATE TABLE table_298883_5 ( reverse VARCHAR, value VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is on the reverse side of the 100 coin?
SELECT reverse FROM table_298883_5 WHERE value = "₩100"
sql_create_context
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 MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '0869256' AND OUT_DIAG_DIS_NM = '急性支气管炎')
css
CREATE TABLE table_23887174_1 ( number_of_cantons__gavars_ VARCHAR, armenian_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different numbers of cantons does the province with the Armenian name have?
SELECT COUNT(number_of_cantons__gavars_) FROM table_23887174_1 WHERE armenian_name = "Վասպուրական"
sql_create_context
CREATE TABLE table_name_67 ( name VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Name of the Players with a Rank of 18?
SELECT name FROM table_name_67 WHERE rank = 18
sql_create_context
CREATE TABLE table_name_77 ( year VARCHAR, opponent VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year for geelong player john roberts?
SELECT year FROM table_name_77 WHERE opponent = "geelong" AND player = "john roberts"
sql_create_context
CREATE TABLE table_46537 ( "Name" text, "Country" text, "Loan Club" text, "Started" text, "Ended" text, "Start Source" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the start source of the irl country, which ended on 13 April?
SELECT "Start Source" FROM table_46537 WHERE "Country" = 'irl' AND "Ended" = '13 april'
wikisql
CREATE TABLE table_name_68 ( country VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when Time is 1:29.43.60?
SELECT country FROM table_name_68 WHERE time = "1:29.43.60"
sql_create_context
CREATE TABLE table_name_38 ( distance VARCHAR, stages VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How long was the 16 staged event in 1997?
SELECT distance FROM table_name_38 WHERE stages = "16" AND year = "1997"
sql_create_context
CREATE TABLE table_name_80 ( wu_xing___五行__ VARCHAR, korean___rr__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Wu Xing ( ) with Korean (RR) of (im)?
SELECT wu_xing___五行__ FROM table_name_80 WHERE korean___rr__ = "임 (im)"
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGu...
SELECT pl.PostId AS "post_link", COUNT(*) FROM PostLinks AS pl INNER JOIN Posts AS p ON p.Id = pl.PostId WHERE LinkTypeId = 3 GROUP BY PostId HAVING COUNT(*) > 2 ORDER BY 2 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 Votes ( Id number, PostId number, VoteTypeId number,...
SELECT DISTINCT u.Id AS "user_link", CONCAT('https://stackoverflow.com/users/', u.Id) AS "profile_link", u.DisplayName, u.Location, u.WebsiteUrl, u.AboutMe, u.Views, u.Reputation, u.UpVotes, u.DownVotes, u.EmailHash FROM Users AS u WHERE UPPER(u.AboutMe) LIKE UPPER('%##AboutMe##%') AND UPPER(DisplayName) LIKE UPPER('%#...
sede
CREATE TABLE table_62584 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player is from south africa?
SELECT "Player" FROM table_62584 WHERE "Country" = 'south africa'
wikisql
CREATE TABLE table_44728 ( "Internet Plan" text, "Downstream" text, "Upstream" text, "Bandwidth Included" text, "Price" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the upstream with the price 65 chf?
SELECT "Upstream" FROM table_44728 WHERE "Price" = '65 chf'
wikisql
CREATE TABLE table_71578 ( "Elector" text, "Order" text, "Title" text, "Elevated" text, "Elevator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Order with an Elector of Marino Bulcani?
SELECT "Order" FROM table_71578 WHERE "Elector" = 'marino bulcani'
wikisql
CREATE TABLE table_name_61 ( finish VARCHAR, to_par VARCHAR, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Finish has a To par of 1, and a Year(s) won of 1955?
SELECT finish FROM table_name_61 WHERE to_par = "–1" AND year_s__won = "1955"
sql_create_context
CREATE TABLE table_name_32 ( nationality VARCHAR, year VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nationality has a year larger than 2009 with a position of power forward?
SELECT nationality FROM table_name_32 WHERE year > 2009 AND position = "power forward"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
(SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '3995688' AND IN_HOSP_DATE BETWEEN '2000-07-01' AND '2011-06-19') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '3995688' AND IN_HOSP_DATE BETWEEN '2000-07-01' AND '2011-06-19' AND MED_ORG_DEPT_CD = '4512')
css
CREATE TABLE table_8150 ( "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. -- Where w...
SELECT "Location Attendance" FROM table_8150 WHERE "Team" = 'minnesota'
wikisql
CREATE TABLE customer ( customerid number, firstname text, lastname text, company text, address text, city text, state text, country text, postalcode text, phone text, fax text, email text, supportrepid number ) CREATE TABLE employee ( employeeid number, last...
SELECT name FROM track WHERE name LIKE '%you%'
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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_2031 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what season did the team get in the conference finals of the playoffs?
SELECT "Regular Season" FROM table_2031 WHERE "Playoffs" = 'Conference Finals'
wikisql
CREATE TABLE table_33397 ( "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 was the crowd size when the away team score...
SELECT COUNT("Crowd") FROM table_33397 WHERE "Away team score" = '7.19 (61)'
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 demographic.marital_status, demographic.days_stay FROM demographic WHERE demographic.subject_id = "6983"
mimicsql_data
CREATE TABLE table_44017 ( "Team" text, "Driver" text, "Class" text, "Chassis" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which driver was in 8 rounds with a chassis of dallara f306?
SELECT "Driver" FROM table_44017 WHERE "Chassis" = 'dallara f306' AND "Rounds" = '8'
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Calcium Carbonate"
mimicsql_data
CREATE TABLE table_name_8 ( points INTEGER, place INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which places have points larger than 10?
SELECT MIN(points) FROM table_name_8 WHERE place > 10
sql_create_context
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE table_5865 ( "Pick #" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Position for the brandon wheat kings (wchl)?
SELECT "Position" FROM table_5865 WHERE "College/junior/club team" = 'brandon wheat kings (wchl)'
wikisql
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Date_of_Birth, Height FROM people ORDER BY Date_of_Birth DESC
nvbench
CREATE TABLE table_2971 ( "April 2013 Cum. Rank" real, "Name" text, "Rank (all) 2012" real, "Rank (all) 2013" real, "2013 Rank (oil companies)" text, "2013 rev (bil. USD )" text, "2013 Profit (mil. USD )" real, "Assets (bil. USD )" text, "Market cap March 15 (mil. USD )" real ) -- ...
SELECT "Rank (all) 2012" FROM table_2971 WHERE "Name" = 'Cenovus Energy'
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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH"
mimicsql_data
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'ORALPATH' AND course.number = 696 AND program_course.category LIKE '%ULCS%'
advising
CREATE TABLE table_13183076_3 ( us_viewers__million_ VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many U.S. viewers (million) are there for the episode whose Production code is 3T7051?
SELECT us_viewers__million_ FROM table_13183076_3 WHERE production_code = "3T7051"
sql_create_context
CREATE TABLE table_71894 ( "Episode" text, "First aired" text, "Entrepreneur(s)" text, "Company or product name" text, "Money requested (\u00a3)" text, "Investing Dragon(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Investing Dragon(s...
SELECT "Investing Dragon(s)" FROM table_71894 WHERE "Episode" = 'episode 9' AND "Entrepreneur(s)" = 'ashley sayed'
wikisql
CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) CREATE TABLE student ( stuid number, ...
SELECT advisor FROM student GROUP BY advisor HAVING COUNT(*) > 2
spider
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 qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '6149241' GROUP BY qtb.IN_DIAG_DIS_NM UNION SELECT gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '6149241' GROUP BY gyb.IN_DIAG_DIS_NM UNION SELECT zyb.IN_DIAG_DIS_NM, AVG(zyb.PERSON_AGE) FROM zyb WHERE zyb....
css