instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE nuclear_power_plants ( id text, name text, latitude text, longitude text, country text, status text, reactortype text, reactormodel text, constructionstartat text, operationalfrom text, operationalto text, capacity text, lastupdatedat text, source tex...
SELECT country FROM nuclear_power_plants GROUP BY country ORDER BY COUNT(name) DESC LIMIT 1
geonucleardata
CREATE TABLE table_name_40 ( nicotine INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Raison Blue has the highest nicotine?
SELECT MAX(nicotine) FROM table_name_40 WHERE name = "raison blue"
sql_create_context
CREATE TABLE table_23995075_2 ( qualifying_start_date VARCHAR, confederation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many qualifying start dates for the Concacaf confederation?
SELECT COUNT(qualifying_start_date) FROM table_23995075_2 WHERE confederation = "CONCACAF"
sql_create_context
CREATE TABLE table_name_13 ( text VARCHAR, date__ce_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which text has a date of c. 1180?
SELECT text FROM table_name_13 WHERE date__ce_ = "c. 1180"
sql_create_context
CREATE TABLE table_name_27 ( dainty_june VARCHAR, herbie VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was Dainty June when Boyd Gaines was Herbie?
SELECT dainty_june FROM table_name_27 WHERE herbie = "boyd gaines"
sql_create_context
CREATE TABLE table_name_39 ( br_no INTEGER, secr_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest BR number with a SECR number of 765?
SELECT MAX(br_no) FROM table_name_39 WHERE secr_no = 765
sql_create_context
CREATE TABLE table_62919 ( "Date Released" text, "Institute" text, "Social Democratic" text, "Socialist" text, "Green-Communist" text, "People's Party" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Social Democratic...
SELECT "Social Democratic" FROM table_62919 WHERE "Green-Communist" = '9.0%' AND "People's Party" = '10.0%' AND "Socialist" = '39.0%'
wikisql
CREATE TABLE table_39535 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Series is on april 18?
SELECT "Series" FROM table_39535 WHERE "Date" = 'april 18'
wikisql
CREATE TABLE table_51098 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played with more than 51,901 attendance and resulted in t 13-13?
SELECT "Opponent" FROM table_51098 WHERE "Attendance" > '51,901' AND "Result" = 't 13-13'
wikisql
CREATE TABLE table_79395 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "# / County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the enrollment for Kendallville?...
SELECT MAX("Enrollment") FROM table_79395 WHERE "Location" = 'kendallville'
wikisql
CREATE TABLE table_name_12 ( march INTEGER, record VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day in March is the game with a 48-13-11 record and a game number less than 72?
SELECT SUM(march) FROM table_name_12 WHERE record = "48-13-11" AND game < 72
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'silibinin (*ind*)')
mimic_iii
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 COUNT(instructor.name), instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EEB' AND course.number = 397 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = cou...
advising
CREATE TABLE table_name_67 ( lost INTEGER, points INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How few losses were the least number of losses and points higher than 23?
SELECT MIN(lost) FROM table_name_67 WHERE points > 23
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road
nvbench
CREATE TABLE table_name_12 ( week INTEGER, opponent VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest week the team played the chicago cardinals in front of less than 25,312?
SELECT MIN(week) FROM table_name_12 WHERE opponent = "chicago cardinals" AND attendance < 25 OFFSET 312
sql_create_context
CREATE TABLE table_name_70 ( start VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the start for year less than 1977
SELECT start FROM table_name_70 WHERE year < 1977
sql_create_context
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12568) AND NOT transfers.wardid IS NULL AND STRFTIME('%y', transfers.intime) >= '2100' ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE table_name_86 ( second VARCHAR, skip VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was second when Martynas Norkus was the skip?
SELECT second FROM table_name_86 WHERE skip = "martynas norkus"
sql_create_context
CREATE TABLE table_51792 ( "Election" text, "D\u00e1il" text, "Share of votes" text, "Seats" real, "Total seats" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- with a share of 44.2% and 77 seats, what is the greatest seat total?
SELECT MAX("Total seats") FROM table_51792 WHERE "Seats" = '77' AND "Share of votes" = '44.2%'
wikisql
CREATE TABLE table_17667 ( "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. -- What is the lowest year that regular season is 4th, Rocky Mountain?
SELECT MIN("Year") FROM table_17667 WHERE "Regular Season" = '4th, Rocky Mountain'
wikisql
CREATE TABLE table_name_86 ( rd VARCHAR, _time VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Rd. Time for October 3, 2009?
SELECT rd, _time FROM table_name_86 WHERE date = "october 3, 2009"
sql_create_context
CREATE TABLE table_name_61 ( rank INTEGER, time INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average rank for 57.05 time?
SELECT AVG(rank) FROM table_name_61 WHERE time < 57.05
sql_create_context
CREATE TABLE table_55652 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Men's doubles has Miyuki Maeda Satoko Suetsu...
SELECT "Men's doubles" FROM table_55652 WHERE "Women's doubles" = 'miyuki maeda satoko suetsuna'
wikisql
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 Id AS "post_link", LENGTH(Body) AS Length, Score, UserRep = (SELECT Reputation FROM Users WHERE Id = OwnerUserId) FROM Posts WHERE PostTypeId = 1 AND CreationDate > 2013 - 01 - 01 ORDER BY LENGTH(Body) DESC LIMIT 500
sede
CREATE TABLE table_11964154_11 ( high_assists VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high assists when the location attendance was Toyota Center 18,370?
SELECT high_assists FROM table_11964154_11 WHERE location_attendance = "Toyota Center 18,370"
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 COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '俞雅韶' AND t_kc22.STA_DATE BETWEEN '2002-11-03' AND '2013-11-20' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_158 ( "Team" text, "Stadium" text, "Capacity" real, "Lowest" real, "Highest" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the highest recorded attendance rates of the stadiums with an average attenda...
SELECT "Highest" FROM table_158 WHERE "Average" = '4752'
wikisql
CREATE TABLE student ( stu_fname VARCHAR, stu_num VARCHAR ) CREATE TABLE CLASS ( class_code VARCHAR, crs_code VARCHAR ) CREATE TABLE enroll ( class_code VARCHAR, stu_num VARCHAR, enroll_grade VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211' AND T2.enroll_grade = 'C'
sql_create_context
CREATE TABLE table_55003 ( "Year" text, "Make & Model" text, "Length" text, "Engine Type" text, "Numbers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For numbers of 2600-2825 (223 buses), what is the length?
SELECT "Length" FROM table_55003 WHERE "Numbers" = '2600-2825 (223 buses)'
wikisql
CREATE TABLE authors ( authid number, lname text, fname text ) CREATE TABLE inst ( instid number, name text, country text ) CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) CREATE TABLE papers ( paperid number, title text ) -...
SELECT COUNT(*) FROM inst
spider
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, COUNT(Sex) FROM people GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE table_2508633_2 ( pick__number INTEGER, nfl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least pick number for the denver broncos
SELECT MIN(pick__number) FROM table_2508633_2 WHERE nfl_team = "Denver Broncos"
sql_create_context
CREATE TABLE table_name_69 ( silver INTEGER, gold VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silvers have 2 as gold, and a bronze less than 2?
SELECT SUM(silver) FROM table_name_69 WHERE gold = 2 AND bronze < 2
sql_create_context
CREATE TABLE table_name_64 ( venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue for the dates 1,2,3,4,6,7 jan 1908?
SELECT venue FROM table_name_64 WHERE date = "1,2,3,4,6,7 jan 1908"
sql_create_context
CREATE TABLE table_name_55 ( series VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the series score of the game on May 6?
SELECT series FROM table_name_55 WHERE date = "may 6"
sql_create_context
CREATE TABLE table_name_27 ( win__number INTEGER, year VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Win #, when Year is '2011-12', and when Points is less than 97?
SELECT MIN(win__number) FROM table_name_27 WHERE year = "2011-12" AND points < 97
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate ...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsIn2107, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId A...
sede
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, u...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '004-79017' AND patient.hospi...
eicu
CREATE TABLE table_name_16 ( title VARCHAR, leading_lady VARCHAR, director VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What title has rouben mamoulian directing after 1940 with linda darnell as the leading lady?
SELECT title FROM table_name_16 WHERE director = "rouben mamoulian" AND year > 1940 AND leading_lady = "linda darnell"
sql_create_context
CREATE TABLE table_name_33 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2012 has a 2009 smaller than 3.38?
SELECT AVG(2012) FROM table_name_33 WHERE 2009 < 3.38
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-153198')) AND intakeoutput.celllabel = 'outp...
eicu
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "Heparin, LMW"
mimicsql_data
CREATE TABLE Catalog_Contents ( catalog_entry_id INTEGER, catalog_level_number INTEGER, parent_entry_id INTEGER, previous_entry_id INTEGER, next_entry_id INTEGER, catalog_entry_name VARCHAR(80), product_stock_number VARCHAR(50), price_in_dollars DOUBLE, price_in_euros DOUBLE, pri...
SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name
nvbench
CREATE TABLE Student_Course_Registrations ( student_id INTEGER, course_id INTEGER, registration_date DATETIME ) CREATE TABLE Students ( student_id INTEGER, student_details VARCHAR(255) ) CREATE TABLE Candidate_Assessments ( candidate_id INTEGER, qualification CHAR(15), assessment_date ...
SELECT course_name, COUNT(*) FROM Students AS T1 JOIN Student_Course_Registrations AS T2 ON T1.student_id = T2.student_id JOIN Courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id ORDER BY course_name DESC
nvbench
CREATE TABLE table_name_55 ( runner_up VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the runner-up of the competition played at Minikahda Club?
SELECT runner_up FROM table_name_55 WHERE venue = "minikahda club"
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBase...
SELECT dbid, name FROM master.sysdatabases WHERE name NOT IN ('Data.StackExchange', 'master', 'model', 'msdb', 'tempdb')
sede
CREATE TABLE table_9788 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a To par of 1, and a Year(s) won of 1952?
SELECT "Player" FROM table_9788 WHERE "To par" = '–1' AND "Year(s) won" = '1952'
wikisql
CREATE TABLE table_11677691_7 ( hometown VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the hometown of trinity high school?
SELECT hometown FROM table_11677691_7 WHERE school = "Trinity High school"
sql_create_context
CREATE TABLE table_42834 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mean number of against when the pos...
SELECT AVG("Against") FROM table_42834 WHERE "Position" < '1'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '006-167444' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-4 year')
eicu
CREATE TABLE table_train_2 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "diabetic" string, "electro_systolic_process" bool, "degenerative_pathology" bool, "neurological_disease" bool, "cardiomyopathy" bool, "NOUSE" float ) -- Using valid SQLite, answer the following ...
SELECT * FROM table_train_2 WHERE cardiomyopathy = 1
criteria2sql
CREATE TABLE table_1787 ( "Country" text, "Population (2011)" real, "GDP (nominal) (2010, US$ millions)" real, "Military expenditures (2011, US$ millions)" real, "Military expenditures (2011, % of GDP)" text, "Defence expenditures, (2011, per capita)" real, "Deployable military (2011, thousa...
SELECT "Deployable military (2011, thousands)" FROM table_1787 WHERE "GDP (nominal) (2010, US$ millions)" = '468539'
wikisql
CREATE TABLE table_train_237 ( "id" int, "fasting_c_peptide" float, "fasting_plasma_glucose" int, "smoking" bool, "body_mass_index_bmi" float, "serum_25_oh_d_levels" int, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- fasted plasma ...
SELECT * FROM table_train_237 WHERE fasting_plasma_glucose <= 260
criteria2sql
CREATE TABLE table_18607260_6 ( played INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least played
SELECT MIN(played) FROM table_18607260_6
sql_create_context
CREATE TABLE table_17624 ( "Number in series" real, "Broadcast Order" text, "Title" text, "Villain/s" text, "U.S. Air Date" text, "Production Code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the series number of the episode with a bro...
SELECT MAX("Number in series") FROM table_17624 WHERE "Broadcast Order" = 'S04 E07'
wikisql
CREATE TABLE table_name_90 ( capacity VARCHAR, torque__nm__rpm VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the capacity for the torque of n m (lb ft) @4150
SELECT capacity FROM table_name_90 WHERE torque__nm__rpm = "n·m (lb·ft) @4150"
sql_create_context
CREATE TABLE table_name_83 ( time VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At what time did the opponent Takaichi Hirayama have an event?
SELECT time FROM table_name_83 WHERE opponent = "takaichi hirayama"
sql_create_context
CREATE TABLE complaints ( complaint_id number, product_id number, customer_id number, complaint_outcome_code text, complaint_status_code text, complaint_type_code text, date_complaint_raised time, date_complaint_closed time, staff_id number ) CREATE TABLE customers ( customer_id...
SELECT email_address, phone_number FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM complaints)
spider
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ci...
SELECT COUNT(*), SUM(student_capacity) FROM Dorm GROUP BY gender
nvbench
CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Roles ( R...
SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(*)
nvbench
CREATE TABLE table_56618 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game against Divij Sharan?
SELECT "Score" FROM table_56618 WHERE "Opponent in the final" = 'divij sharan'
wikisql
CREATE TABLE table_name_31 ( score VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the match that took place in the playoff round?
SELECT score FROM table_name_31 WHERE round = "playoff"
sql_create_context
CREATE TABLE table_name_99 ( grid INTEGER, laps VARCHAR, constructor VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest grid value with constructor Mclaren - Mercedes, driver David Coulthard, and has fewer than 66 laps...
SELECT MAX(grid) FROM table_name_99 WHERE constructor = "mclaren - mercedes" AND driver = "david coulthard" AND laps < 66
sql_create_context
CREATE TABLE table_9684 ( "Rank" real, "Airport" text, "Location" text, "2011" real, "2010" real, "2009" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total number of aircrafts in 2011 for sydney airport that was ranked number 1?
SELECT COUNT("2011") FROM table_9684 WHERE "Airport" = 'sydney airport' AND "Rank" < '1'
wikisql
CREATE TABLE table_name_15 ( seasons_in_csl VARCHAR, top_division_titles__overall_ VARCHAR, home_stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the years for Seasons in CSL when they played in the Guiyang Olympic Sports Center and had T...
SELECT seasons_in_csl FROM table_name_15 WHERE top_division_titles__overall_ = 0 AND home_stadium = "guiyang olympic sports center"
sql_create_context
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3816229' AND gwyjzb.IN_DIAG_DIS_NM = '急性根尖周炎' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3816229' AND fgwyjzb.IN_DIAG...
css
CREATE TABLE table_name_16 ( total INTEGER, rank VARCHAR, silver VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest total when silver is 0, and gold is less than 1, and rank is less than 13?
SELECT MIN(total) FROM table_name_16 WHERE silver = 0 AND gold < 1 AND rank < 13
sql_create_context
CREATE TABLE table_name_79 ( original_title VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the original title directed by sudhendu roy
SELECT original_title FROM table_name_79 WHERE director = "sudhendu roy"
sql_create_context
CREATE TABLE table_68493 ( "Circuit" text, "Location / State" text, "Date" text, "Winning driver" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what date did the m3 motorsport team compete at winton motor raceway?
SELECT "Date" FROM table_68493 WHERE "Team" = 'm3 motorsport' AND "Circuit" = 'winton motor raceway'
wikisql
CREATE TABLE table_name_5 ( cuts_made INTEGER, wins INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the highest cuts made with wins more than 1
SELECT MAX(cuts_made) FROM table_name_5 WHERE wins > 1
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT mzjzjlb.KH, mzjzjlb.KLX FROM mzjzjlb WHERE mzjzjlb.JZLSH = '96594667159'
css
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.diagnosis, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "17787"
mimicsql_data
CREATE TABLE table_7645 ( "Draw" real, "Song" text, "Performer" text, "Points" real, "Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points did Nigel Connell have?
SELECT "Points" FROM table_7645 WHERE "Performer" = 'nigel connell'
wikisql
CREATE TABLE table_37684 ( "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 district is St Martin's Without parish in with a population less than 75?
SELECT "District" FROM table_37684 WHERE "Population" < '75' AND "Name" = 'st martin''s without'
wikisql
CREATE TABLE table_74899 ( "Round" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Winning team has 22 July as a Date?
SELECT "Winning team" FROM table_74899 WHERE "Date" = '22 july'
wikisql
CREATE TABLE table_203_418 ( id number, "#" number, "player" text, "position" text, "height" number, "current club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many players have a height of at least 1.90 ?
SELECT COUNT("player") FROM table_203_418 WHERE "height" >= 1.90
squall
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_56241 ( "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Pole Position of ...
SELECT "Pole Position" FROM table_56241 WHERE "Race" = 'swedish grand prix'
wikisql
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of people w...
SELECT gender, COUNT(*) FROM Person WHERE age < 40 GROUP BY gender ORDER BY gender
nvbench
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 DISTINCT T1.advisor FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.treasurer_vote WHERE T2.election_cycle = "Spring"
spider
CREATE TABLE table_name_43 ( pat_robertson VARCHAR, bob_dole VARCHAR, pete_du_pont VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Bob Dole had 26%, and Pete du Pont had 0%, what did Pat Robertson have?
SELECT pat_robertson FROM table_name_43 WHERE bob_dole = "26%" AND pete_du_pont = "0%"
sql_create_context
CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advis...
SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = "HOU"
spider
CREATE TABLE table_73652 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many millions o...
SELECT "U.S. viewers (million)" FROM table_73652 WHERE "Directed by" = 'Kevin Bray'
wikisql
CREATE TABLE tracks ( name VARCHAR, id VARCHAR ) CREATE TABLE playlist_tracks ( track_id VARCHAR, playlist_id VARCHAR ) CREATE TABLE playlists ( id VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the name of all tracks in ...
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = "Movies"
sql_create_context
CREATE TABLE table_name_80 ( league_one_second_division VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the league one/second division for club of millwall
SELECT league_one_second_division FROM table_name_80 WHERE club = "millwall"
sql_create_context
CREATE TABLE table_40404 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was played against in the final on November 14, 1994?
SELECT "Opponent in the final" FROM table_40404 WHERE "Date" = 'november 14, 1994'
wikisql
CREATE TABLE table_name_62 ( grid INTEGER, team VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Grid has a Team of rusport, and Laps larger than 221?
SELECT SUM(grid) FROM table_name_62 WHERE team = "rusport" AND laps > 221
sql_create_context
CREATE TABLE host ( host_id number, name text, nationality text, age text ) CREATE TABLE party ( party_id number, party_theme text, location text, first_year text, last_year text, number_of_hosts number ) CREATE TABLE party_host ( party_id number, host_id number, is...
SELECT name FROM host WHERE NOT host_id IN (SELECT host_id FROM party_host)
spider
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure - due to neurological process' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(C...
eicu
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number,...
SELECT Id, PostTypeId, CreationDate, Tags FROM Posts WHERE CreationDate LIKE '%2017%' AND NOT NULLIF(Tags, '') IS NULL
sede
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
SELECT FIRST_NAME, COUNT(FIRST_NAME) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME ORDER BY FIRST_NAME DESC
nvbench
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 person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf...
css
CREATE TABLE table_24333 ( "Season" real, "Episode" real, "Episode Summary" text, "Premier date" text, "External Link" text, "Coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the coach for may 20, 2010
SELECT "Coach" FROM table_24333 WHERE "Premier date" = 'May 20, 2010'
wikisql
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX 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 t...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb....
css
CREATE TABLE table_name_37 ( Chief VARCHAR, judge VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was Judge Jack Edward Tanner's chief judge?
SELECT Chief AS judge FROM table_name_37 WHERE judge = "jack edward tanner"
sql_create_context
CREATE TABLE table_33065 ( "Season" text, "Group I" text, "Group II" text, "Group III" text, "Group IV" text, "Group V" text, "Group VI" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season has Group IV Sevilla, Group VI las palmas, gr...
SELECT "Season" FROM table_33065 WHERE "Group IV" = 'sevilla' AND "Group VI" = 'las palmas' AND "Group III" = 'barcelona' AND "Group I" = 'sporting'
wikisql
CREATE TABLE procedures ( 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 ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "72" AND prescriptions.route = "TD"
mimicsql_data
CREATE TABLE table_42533 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Attendance has a Week smaller than 8, and an Opponent of philadelphia eagles?
SELECT "Attendance" FROM table_42533 WHERE "Week" < '8' AND "Opponent" = 'philadelphia eagles'
wikisql
CREATE TABLE table_256286_19 ( meas_num INTEGER, _percentage_yes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest measure number for the measure with a 33.57% yes percentage?
SELECT MIN(meas_num) FROM table_256286_19 WHERE _percentage_yes = "33.57%"
sql_create_context