instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_31743 ( "Current Name" text, "Year First Opened" real, "Manufacturer" text, "Location in Park" text, "Thrill/Intensity Rating" text, "Minimum Height Requirements" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ride opened...
SELECT "Current Name" FROM table_31743 WHERE "Year First Opened" > '2011'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
SELECT DISTINCT department, description, number FROM course WHERE (department = 'ANAT' AND number = 504) OR (department = 'ANAT' AND number = 499)
advising
CREATE TABLE table_28582 ( "Athlete" text, "Event" text, "Round of 32" text, "Round of 16" text, "Quarterfinals" text, "Semifinals" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If round of 32 is sawatvilay phimmasone ( lao ) w pts 9-7, what wa...
SELECT "Event" FROM table_28582 WHERE "Round of 32" = 'Sawatvilay Phimmasone ( LAO ) W PTS 9-7'
wikisql
CREATE TABLE table_71914 ( "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. -- What Country does Larry Mize play for?
SELECT "Country" FROM table_71914 WHERE "Player" = 'larry mize'
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '97104929' AND gwyjzb.MED_SER_ORG_NO = '0510522' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '97104929' AND fg...
css
CREATE TABLE table_35511 ( "Dish" text, "Callsign" text, "Network" text, "Resolution" text, "City of License" text, "Official Website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which city is the network with the callsign kgns-dt3 license...
SELECT "City of License" FROM table_35511 WHERE "Callsign" = 'kgns-dt3'
wikisql
CREATE TABLE table_68001 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the winning score 9 (72-68-64-67=271)?
SELECT "Date" FROM table_68001 WHERE "Winning score" = '−9 (72-68-64-67=271)'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate tim...
SELECT * FROM Posts WHERE Id = 58461807
sede
CREATE TABLE table_62030 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Party, when Incumbent is 'Rodney Alexander'?
SELECT "Party" FROM table_62030 WHERE "Incumbent" = 'rodney alexander'
wikisql
CREATE TABLE table_76035 ( "Tournament" text, "Wins" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of cuts made of tournaments with 2 Events?
SELECT COUNT("Cuts made") FROM table_76035 WHERE "Events" = '2'
wikisql
CREATE TABLE table_78324 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many golds for the nation with 14 total?
SELECT "Gold" FROM table_78324 WHERE "Total" = '14'
wikisql
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), fam...
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion)
nvbench
CREATE TABLE table_43934 ( "Goal" real, "Date" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Goal that has the Result of 2-0?
SELECT "Goal" FROM table_43934 WHERE "Result" = '2-0'
wikisql
CREATE TABLE table_name_53 ( goals INTEGER, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of goals that occurred in Hong Kong Stadium, Hong Kong?
SELECT AVG(goals) FROM table_name_53 WHERE venue = "hong kong stadium, hong kong"
sql_create_context
CREATE TABLE table_2233872_1 ( l INTEGER, ga VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the minimum L if the GA is 272?
SELECT MIN(l) FROM table_2233872_1 WHERE ga = 272
sql_create_context
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 SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '32352612' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-03-18' AND '2021-05-07' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fg...
css
CREATE TABLE table_52346 ( "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. -- Who was the home team when the attendance was mo...
SELECT "Home team" FROM table_52346 WHERE "Crowd" > '20,283'
wikisql
CREATE TABLE wdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT wdmzjzjlb.JZZDBM, wdmzjzjlb.JZZDSM FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '04766244693' UNION SELECT bdmzjzjlb.JZZDBM, bdmzjzjlb.JZZDSM FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '04766244693'
css
CREATE TABLE table_train_196 ( "id" int, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "renal_disease" bool, "diabetic" string, "diastolic_blood_pressure_dbp" int, "serum_creatinine" float, "hypertension" bool, "NOUSE" float ) -- Using valid SQLite, answer the following ...
SELECT * FROM table_train_196 WHERE diabetic = 'ii'
criteria2sql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
nvbench
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight te...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT...
atis
CREATE TABLE table_26710 ( "Legion no and title" text, "Main legion base" text, "Emblem" text, "Date founded/ founder" text, "Date disband" text, "Castra legionaria (legion bases) * = main base. Start date 31 BC if unspecified" text, "Notes" text ) -- Using valid SQLite, answer the followi...
SELECT "Notes" FROM table_26710 WHERE "Date founded/ founder" = '57 BC Caesar'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal bool...
SELECT t.TagName, COUNT(*) AS NumberOfQuestions FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE PostTypeId = 1 AND t.TagName IN ('suitest', 'doh', 'lbrtw-ut', 'jsunit', 'enhance-js', 'qunit', 'rhunit', 'crosscheck', 'j3unit', 'mocha', 'intern', 'jsnunit', 'yui...
sede
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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '91170006' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 6315.09)
css
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_ID = '63411800' AND t_kc22.STA_DATE BETWEEN '2002-11-23' AND '2008-08-03' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_name_61 ( total INTEGER, fa_cup VARCHAR, fa_trophy VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average total with 1 FA cup and more than 0 FA trophies?
SELECT AVG(total) FROM table_name_61 WHERE fa_cup = 1 AND fa_trophy > 0
sql_create_context
CREATE TABLE customers ( email_address VARCHAR, phone_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the emails and phone numbers of all the customers, ordered by email address and phone number.
SELECT email_address, phone_number FROM customers ORDER BY email_address, phone_number
sql_create_context
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId nu...
SELECT Posts.Id, Posts.Title, Posts.Body FROM Posts AS posts WHERE Posts.Tags LIKE '%<java>%' AND Posts.Tags LIKE '%<spring>%' AND Posts.PostTypeId = 1 AND Posts.CommentCount > 0
sede
CREATE TABLE table_65763 ( "Ship name" text, "Year built" real, "Length" text, "Crew" real, "Guests" real, "Staterooms" real, "Comments" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of staterooms in with a year buit of 2008...
SELECT SUM("Staterooms") FROM table_65763 WHERE "Year built" = '2008' AND "Crew" < '28'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT * FROM jybgb WHERE jybgb.JZLSH = '25823611070'
css
CREATE TABLE table_name_42 ( points INTEGER, rank VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average points value for a rank less than 12 for David Santee?
SELECT AVG(points) FROM table_name_42 WHERE rank < 12 AND name = "david santee"
sql_create_context
CREATE TABLE table_4632 ( "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 day does the team play at punt road oval?
SELECT "Date" FROM table_4632 WHERE "Venue" = 'punt road oval'
wikisql
CREATE TABLE table_name_20 ( first_store VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the first store in India?
SELECT first_store FROM table_name_20 WHERE country = "india"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT t_kc21.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '9881939' GROUP BY t_kc21.MED_ORG_DEPT_NM
css
CREATE TABLE table_name_61 ( malayalam VARCHAR, മലയാളം VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE MALAYAM WITH of ?
SELECT malayalam FROM table_name_61 WHERE മലയാളം = "വെള്ളി"
sql_create_context
CREATE TABLE weather ( date text, max_temperature_f number, mean_temperature_f number, min_temperature_f number, max_dew_point_f number, mean_dew_point_f number, min_dew_point_f number, max_humidity number, mean_humidity number, min_humidity number, max_sea_level_pressure_inc...
SELECT bike_id FROM trip WHERE zip_code = 94002 GROUP BY bike_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_53143 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps for jochen rindt?
SELECT COUNT("Laps") FROM table_53143 WHERE "Driver" = 'jochen rindt'
wikisql
CREATE TABLE table_name_65 ( resolution VARCHAR, active_pixels VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the resolution of the camera that has 6726 x 5040 pixels and a model of afi 7?
SELECT resolution FROM table_name_65 WHERE active_pixels = "6726 x 5040" AND model = "afi 7"
sql_create_context
CREATE TABLE table_15327489_1 ( class VARCHAR, riders VARCHAR, races VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the class for makoto tamada and races is 17
SELECT class FROM table_15327489_1 WHERE riders = "Makoto Tamada" AND races = "17"
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 t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '鲁清馨' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 8259.58)
css
CREATE TABLE table_4205 ( "Country / region" text, "Channel" text, "Series premiere" text, "Title in country" text, "Source(s)" text, "Airing?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country is in the region of France?
SELECT "Title in country" FROM table_4205 WHERE "Country / region" = 'France'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 58649) AND DATETIME(icustays.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE table_17641206_2 ( written_by VARCHAR, viewership VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people wrote the episode that had 6.34 million viewers?
SELECT COUNT(written_by) FROM table_17641206_2 WHERE viewership = "6.34 million"
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND prescriptions.drug = "NEO*PO*Vitamin E Drops"
mimicsql_data
CREATE TABLE table_44221 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE LOWEST ROUND FOR CB POSITION?
SELECT MIN("Round") FROM table_44221 WHERE "Position" = 'cb'
wikisql
CREATE TABLE table_73334 ( "Administrative division" text, "Area (km\u00b2) 2005" text, "Population 2010 Census" real, "Population 2011 SIAK Database" text, "Population density (/km\u00b2 2010)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which a...
SELECT "Administrative division" FROM table_73334 WHERE "Population 2011 SIAK Database" = '606,699'
wikisql
CREATE TABLE table_11414 ( "Name" text, "Builder" text, "Type" text, "Date" real, "Works number" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average work number of Snowdon Ranger with the builder Vulcan Foundry?
SELECT AVG("Works number") FROM table_11414 WHERE "Builder" = 'vulcan foundry' AND "Name" = 'snowdon ranger'
wikisql
CREATE TABLE table_name_65 ( original_airdate VARCHAR, episode__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Episode 29 (7) originally air?
SELECT original_airdate FROM table_name_65 WHERE episode__number = "29 (7)"
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 Votes ( Id number, PostId number, ...
SELECT * FROM Users AS up LEFT JOIN Posts AS pp ON up.Id = pp.OwnerUserId LEFT JOIN Posts AS pa ON pp.Id = pa.ParentId LEFT JOIN Users AS ua ON ua.Id = pa.OwnerUserId WHERE pp.Id IN (31510351, 31511444, 31511708)
sede
CREATE TABLE table_52611 ( "Block A" text, "Akira" text, "Atsushi Aoki" text, "Black Tiger V" text, "Jado" text, "Milano Collection A.T." text, "Prince Devitt" text, "Tiger Mask IV" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ...
SELECT "Atsushi Aoki" FROM table_52611 WHERE "Black Tiger V" = 'ibushi (16:35)'
wikisql
CREATE TABLE table_name_3 ( event VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What even was held in Valencia, Spain?
SELECT event FROM table_name_3 WHERE venue = "valencia, spain"
sql_create_context
CREATE TABLE table_57324 ( "Rank" real, "Name" text, "Nation" text, "Placings" real, "Figures" real, "Free" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the average Figures that has the Placings of 34, and the...
SELECT AVG("Figures") FROM table_57324 WHERE "Placings" = '34' AND "Total" > '1247.51'
wikisql
CREATE TABLE table_39234 ( "Nation" text, "T Score" real, "A Score" real, "E Score" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the T score of the team with an E score of 6.625?
SELECT "T Score" FROM table_39234 WHERE "E Score" = '6.625'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTas...
SELECT * FROM Posts WHERE Id = 02154
sede
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, descript...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SA...
atis
CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text, acc_percent text, acc_home text, acc_road text, all_games text, all_games_percent number, all_home text, all_road text, all_neutral text ) CREATE TABLE university (...
SELECT school, location FROM university WHERE affiliation = 'Public'
spider
CREATE TABLE table_66148 ( "Name" text, "License" text, "OS X" text, "Unix-like" text, "Windows" text, "Web Interface" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name when Windows is partial?
SELECT "Name" FROM table_66148 WHERE "Windows" = 'partial'
wikisql
CREATE TABLE table_64836 ( "Japanese Title" text, "English Title" text, "Year" real, "First publisher" text, "ISBN" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the First Publisher in 2007?
SELECT "First publisher" FROM table_64836 WHERE "Year" = '2007'
wikisql
CREATE TABLE table_62087 ( "Device" text, "Carrier" text, "Package Version" text, "Applications" text, "Software Platform" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE CARRIER WITH 5.0.0.742 VERSION?
SELECT "Carrier" FROM table_62087 WHERE "Package Version" = '5.0.0.742'
wikisql
CREATE TABLE table_30134 ( "Rnd" real, "Circuit" text, "GT Winning Car" text, "SS Winning Car" text, "A Winning Car" text, "B Winning Car" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the b winning car for #88 team mits...
SELECT "B Winning Car" FROM table_30134 WHERE "A Winning Car" = '#88 Team Mitsubishi 88 Mitsubishi Starion'
wikisql
CREATE TABLE volume ( Volume_ID int, Volume_Issue text, Issue_Date text, Weeks_on_Top real, Song text, Artist_ID int ) CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE artist ( Ar...
SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result ORDER BY COUNT(Result) DESC
nvbench
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE student_record ( student_id int, course_id int, semest...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
advising
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "31" AND diagnoses.short_title = "Crnry athrscl natve vssl"
mimicsql_data
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ...
SELECT * FROM Posts WHERE NOT Posts.Title IS NULL AND LOWER(Posts.Tags) LIKE '%java%' ORDER BY Posts.Score DESC LIMIT 10
sede
CREATE TABLE table_15437 ( "Week" text, "Theme" text, "Song choice" text, "Original artist" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which week had a theme of Heroes?
SELECT "Week" FROM table_15437 WHERE "Theme" = 'heroes'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18877 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND microbiologyevents.spec_type_desc = 'bronchoalveolar lavage' AND NOT microbiology...
mimic_iii
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_jyjgzbb ( JYZBLSH number, ...
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '67013595973' GROUP BY jybgb.SHRGH HAVING COUNT(*) > 11
css
CREATE TABLE table_40184 ( "Rank" real, "Prev" real, "Player" text, "Rating" real, "Chng" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest prev that has 9 as the rank, with a rating less than 2746?
SELECT MAX("Prev") FROM table_40184 WHERE "Rank" = '9' AND "Rating" < '2746'
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 Sex, AVG(Height) FROM people GROUP BY Sex
nvbench
CREATE TABLE table_14650162_1 ( nfl_team VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NFL team of the player whose college is Minnesota?
SELECT nfl_team FROM table_14650162_1 WHERE college = "Minnesota"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND diagnoses.long_title = "Ostium secundum type atrial septal defect"
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 zzmzjzjlb.SG, zzmzjzjlb.TZ FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '23887920' UNION SELECT fzzmzjzjlb.SG, fzzmzjzjlb.TZ FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AND hz_info.KH = f...
css
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 COUNT(*) AS count FROM Posts WHERE PostTypeId = 1
sede
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.age < "79" AND procedures.short_title = "Suture of artery"
mimicsql_data
CREATE TABLE table_name_65 ( time VARCHAR, lane VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is the lane less than 5 and is named gnes kov cs?
SELECT time FROM table_name_65 WHERE lane < 5 AND name = "ágnes kovács"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "30" AND diagnoses.short_title = "Idio periph neurpthy NOS"
mimicsql_data
CREATE TABLE table_15162479_8 ( eviction_result VARCHAR, eviction_no VARCHAR, vote_to_save VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many eviction results occurred with a eviction no. 12 and a vote to save of 2.76%?
SELECT COUNT(eviction_result) FROM table_15162479_8 WHERE eviction_no = 12 AND vote_to_save = "2.76%"
sql_create_context
CREATE TABLE table_55701 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the low silver total for switzerland with over 0 golds?
SELECT MIN("Silver") FROM table_55701 WHERE "Gold" > '0' AND "Nation" = 'switzerland'
wikisql
CREATE TABLE table_43078 ( "Club" text, "Winners" real, "Runners-up" real, "Winning Years" text, "Runner-up Years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the runners-up for the FC Viktoria Plze club?
SELECT "Runners-up" FROM table_43078 WHERE "Club" = 'fc viktoria plzeň'
wikisql
CREATE TABLE minor_in ( stuid number, dno number ) CREATE TABLE gradeconversion ( lettergrade text, gradepoint number ) CREATE TABLE course ( cid text, cname text, credits number, instructor number, days text, hours text, dno number ) CREATE TABLE enrolled_in ( stuid n...
SELECT cname FROM course WHERE credits = 1
spider
CREATE TABLE table_name_40 ( home VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team on March 5, 2008?
SELECT home FROM table_name_40 WHERE date = "march 5, 2008"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT procedures.short_title FROM procedures WHERE procedures.subject_id = "74032"
mimicsql_data
CREATE TABLE apartment_buildings ( building_id number, building_short_name text, building_full_name text, building_description text, building_address text, building_manager text, building_phone text ) CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_d...
SELECT DISTINCT T2.apt_number FROM apartment_bookings AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Confirmed"
spider
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-86136')) AND STRFTIME('%y-%m', medication.drugstarttime) =...
eicu
CREATE TABLE table_name_97 ( total VARCHAR, nation VARCHAR, e_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of Poland, which has an E score greater than 7.725?
SELECT COUNT(total) FROM table_name_97 WHERE nation = "poland" AND e_score > 7.725
sql_create_context
CREATE TABLE table_48258 ( "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date was the match with partner Kira Nagy?
SELECT "Date" FROM table_48258 WHERE "Partner" = 'kira nagy'
wikisql
CREATE TABLE table_61526 ( "Quarterback" text, "Games" real, "Teams" text, "Wins" real, "Losses" real, "Percent" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average wins when teams is lions and the percent is more than 0?
SELECT AVG("Wins") FROM table_61526 WHERE "Teams" = 'lions' AND "Percent" > '0'
wikisql
CREATE TABLE table_3670 ( "Hand Number" real, "Prevailing Wind" text, "Player 1" text, "Player 2" text, "Player 3" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the hand number of the hand where player 1 is south and the east wind is prevai...
SELECT COUNT("Hand Number") FROM table_3670 WHERE "Player 1" = 'South' AND "Prevailing Wind" = 'East'
wikisql
CREATE TABLE table_11105 ( "Suburb" text, "Population (in 2008)" real, "Median age (in 2006)" text, "Mean household size (in 2006)" text, "Area (km\u00b2)" real, "Density (/km\u00b2)" real, "Date first settled as a suburb" real, "Gazetted as a Division Name" text ) -- Using valid SQLit...
SELECT SUM("Area (km\u00b2)") FROM table_11105 WHERE "Median age (in 2006)" = '38 years' AND "Population (in 2008)" = '2,444' AND "Date first settled as a suburb" < '1965'
wikisql
CREATE TABLE accounts ( account_id number, customer_id number, date_account_opened time, account_name text, other_account_details text ) CREATE TABLE orders ( order_id number, customer_id number, date_order_placed time, order_details text ) CREATE TABLE invoices ( invoice_numbe...
SELECT DISTINCT product_size FROM products
spider
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, K...
SELECT jybgb.BGDH FROM hz_info JOIN txmzjzjlb JOIN jybgb ON 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.JZLSH_MZJZJLB WHERE hz_info.RYBH = '33303356' AND jybgb.BGRQ BETWEEN '2011-04-24' AND '2015-...
css
CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, ...
SELECT COUNT(*) FROM files WHERE duration LIKE "4:%"
spider
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY lab.labname) AS t1 WHER...
eicu
CREATE TABLE department ( dept_name text, building text, budget number ) CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE time_slot ( time_slot_id text, day text, start_hr number, start_min number, end_hr number, end_min numb...
SELECT SUM(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'
spider
CREATE TABLE table_7775 ( "Date" text, "Event" text, "City" text, "Oil Pattern" text, "Winner (Title #)" text, "Runner-up" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the oil pattern for runner-up Pete Weber?
SELECT "Oil Pattern" FROM table_7775 WHERE "Runner-up" = 'pete weber'
wikisql
CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby...
SELECT DISTINCT author.authorname, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname <> 'chris dyer' AND keyphrase.keyphrasename = 'syntactic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author....
scholar
CREATE TABLE table_18331 ( "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 outcomes were there in the elections in California 38?
SELECT COUNT("Result") FROM table_18331 WHERE "District" = 'California 38'
wikisql
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 zyjybgb.SQRGH, zyjybgb.SQRXM FROM zyjybgb WHERE zyjybgb.BGDH = '38996454394' UNION SELECT mzjybgb.SQRGH, mzjybgb.SQRXM FROM mzjybgb WHERE mzjybgb.BGDH = '38996454394'
css
CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, production_type_code VARCHAR(15), unit_price DECIMAL(19,4), product_name VARCHAR(80), product_color VARCHAR(20), produ...
SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type ORDER BY SUM(transaction_amount) DESC
nvbench
CREATE TABLE table_25091 ( "Year" real, "Network" text, "Race caller" text, "s Host" text, "s Analyst" text, "Reporters" text, "Trophy presentation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the reporters for 2003
SELECT "Reporters" FROM table_25091 WHERE "Year" = '2003'
wikisql