instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( trea...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) = '2103' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE artist ( Famous_Release_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the distinct Famous release dates?
SELECT DISTINCT (Famous_Release_date) FROM artist
sql_create_context
CREATE TABLE table_11464746_1 ( house_name VARCHAR, colours VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the green house?
SELECT house_name FROM table_11464746_1 WHERE colours = "Green"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT c.Id AS cid, c.Id AS "comment_link", c.PostId AS pid, c.Score AS csc, c.CreationDate AS cti, c.UserId AS "user_link" FROM Comments AS c WHERE c.Text LIKE '%##string?/~efriedma/##%' ORDER BY c.Id
sede
CREATE TABLE table_name_65 ( birth VARCHAR, became_duchess VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Birth has a Became Duchess of 17 april 1711 husband's ascension?
SELECT birth FROM table_name_65 WHERE became_duchess = "17 april 1711 husband's ascension"
sql_create_context
CREATE TABLE table_25353861_5 ( steals INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many steals did Kelly Miller have?
SELECT MIN(steals) FROM table_25353861_5 WHERE player = "Kelly Miller"
sql_create_context
CREATE TABLE table_7010 ( "Location" text, "Aircraft" text, "Tail number" text, "Aircraft damage" text, "Fatalities" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the aircraft damage for the Boeing 707-320B?
SELECT "Aircraft damage" FROM table_7010 WHERE "Aircraft" = 'boeing 707-320b'
wikisql
CREATE TABLE table_name_49 ( series VARCHAR, city___state VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what series was in sydney, new south wales?
SELECT series FROM table_name_49 WHERE city___state = "sydney, new south wales"
sql_create_context
CREATE TABLE table_10779 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the height of the player from Elizabeth, NJ?
SELECT "Height" FROM table_10779 WHERE "Hometown" = 'elizabeth, nj'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE requirement (...
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '3:00' AND course_offering.start_time >= '11:00' AND course.course_id = course_offering.course_id AND course.department = 'LATINOAM' AND course.nu...
advising
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, ...
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date) DESC
nvbench
CREATE TABLE table_name_14 ( type VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Type has a Name of edson ratinho?
SELECT type FROM table_name_14 WHERE name = "edson ratinho"
sql_create_context
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 AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3554465' AND t_kc21.IN_HOSP_DATE BETWEEN '2008-07-28' AND '2019-05-22'
css
CREATE TABLE table_16516 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What days are vacant that were replaced...
SELECT "Date of vacancy" FROM table_16516 WHERE "Replaced by" = 'John Brown'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text...
SELECT (Title) FROM Posts WHERE CreationDate > '2016-11-05 14:29:36'
sede
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 SuggestedEditVotes ( Id number, SuggestedEditId num...
SELECT Score, COUNT(*) AS "question_scores" FROM Posts WHERE PostTypeId = 2 AND Score >= -10 AND Score <= 30 AND YEAR(CreationDate) >= 2019 GROUP BY Score ORDER BY Score
sede
CREATE TABLE table_49084 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Visitor of edmonton?
SELECT "Date" FROM table_49084 WHERE "Visitor" = 'edmonton'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb 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 = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG...
css
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE class_of_ser...
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 (((flight.arrival_time <= 2000 AND flight.arrival_time >= 1200) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. LOUIS' AND flight....
atis
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY Investor
nvbench
CREATE TABLE table_name_68 ( english_title VARCHAR, year VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the English title for 1984 from Sweden?
SELECT english_title FROM table_name_68 WHERE year = 1984 AND country = "sweden"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, ...
SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-76990')) AND lab.labname = 'mcv' AND STRFTIME('%y', lab.labresulttime) >= '210...
eicu
CREATE TABLE table_name_29 ( road_team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Road Team, when Date is 'April 10'?
SELECT road_team FROM table_name_29 WHERE date = "april 10"
sql_create_context
CREATE TABLE table_name_77 ( attendance INTEGER, dolphins_points VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the most in attendance when the Dolphins points were less than 24 and, they played the New England Patriots?
SELECT MAX(attendance) FROM table_name_77 WHERE dolphins_points < 24 AND opponent = "new england patriots"
sql_create_context
CREATE TABLE table_name_88 ( record VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Record has a Score of l 97 99 (ot)?
SELECT record FROM table_name_88 WHERE score = "l 97–99 (ot)"
sql_create_context
CREATE TABLE table_22103 ( "Rank" real, "Airport Name" text, "Location" text, "IATA Code" text, "Tonnes" text, "% Chg. 2010/11" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank is the airport whose IATA Code is JFK?
SELECT "Rank" FROM table_22103 WHERE "IATA Code" = 'JFK'
wikisql
CREATE TABLE table_203_865 ( id number, "place" number, "athlete" text, "nation" text, "best mark" text, "throw 1" number, "throw 2" number, "throw 3" number, "throw 4" number, "throw 5" number, "throw 6" number ) -- Using valid SQLite, answer the following questions for th...
SELECT "athlete" FROM table_203_865 ORDER BY "best mark" LIMIT 1
squall
CREATE TABLE semester ( semester_id int, semester varchar, year int ) 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...
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'CJS' AND course.number = 799 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.of...
advising
CREATE TABLE table_66271 ( "School" text, "Mascot" text, "Location" 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 county has a football team in IHSAA cl...
SELECT "County" FROM table_66271 WHERE "IHSAA Football Class" = 'aaaaa' AND "Mascot" = 'grizzly cubs'
wikisql
CREATE TABLE table_45921 ( "Date" text, "Opponents" text, "Venue" text, "Result" text, "Score F\u2013A" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game played on 17 July 2008?
SELECT "Result" FROM table_45921 WHERE "Date" = '17 july 2008'
wikisql
CREATE TABLE table_77023 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Rank, when Nation is Great Britain, and when Bronze is less than 1?
SELECT MIN("Rank") FROM table_77023 WHERE "Nation" = 'great britain' AND "Bronze" < '1'
wikisql
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 admissions.admittime FROM admissions WHERE admissions.subject_id = 23938 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE table_name_68 ( goals_against INTEGER, goals_for VARCHAR, goal_difference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average of goals against, where overall goals are more than 35 and the goal difference is 20?
SELECT AVG(goals_against) FROM table_name_68 WHERE goals_for > 35 AND goal_difference = 20
sql_create_context
CREATE TABLE table_53919 ( "Year" real, "Date" text, "Winner" text, "Result" text, "Loser" text, "Attendance" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the green bay packers win at green bay with an attendance ...
SELECT "Date" FROM table_53919 WHERE "Location" = 'green bay' AND "Winner" = 'green bay packers' AND "Attendance" > '70,920'
wikisql
CREATE TABLE table_73912 ( "Outcome" text, "No." text, "Date" text, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the championship Miami , United Sta...
SELECT "Score in the final" FROM table_73912 WHERE "Championship" = 'Miami , United States'
wikisql
CREATE TABLE table_204_294 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in 2007 , how many games did the n...
SELECT COUNT(*) FROM table_204_294 WHERE "rank#" IS NULL
squall
CREATE TABLE table_24734 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Slovak title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did jaroslav vojtek category:articles with hcards Direct...
SELECT "Year (Ceremony)" FROM table_24734 WHERE "Director" = 'Jaroslav Vojtek Category:Articles with hCards'
wikisql
CREATE TABLE table_203_802 ( id number, "persian unit" text, "persian name" text, "relation to previous unit" text, "metric value" text, "imperial value" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what unit is listed first ?
SELECT "persian unit" FROM table_203_802 WHERE id = 1
squall
CREATE TABLE table_19965 ( "Year (Ceremony)" real, "Original title" text, "English title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for director Fernando Meirelles
SELECT "Result" FROM table_19965 WHERE "Director" = 'Fernando Meirelles'
wikisql
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 COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '4874036' AND wdmzjzjlb.JZKSRQ BETWEEN '2014-02-21' AND '2017-10-12' AND wdmzjzjlb.TXBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '4874036' AND bdmzjzjlb.JZKSRQ BETWEEN '2014-02-21' AND '2017-10-12' AND bdmzjzjlb.TXBZ > 0
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 * FROM t_kc21 WHERE t_kc21.PERSON_ID = '22167047' AND t_kc21.MED_SER_ORG_NO = '4933227' AND NOT t_kc21.MED_ORG_DEPT_NM LIKE '%重症%'
css
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, ...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1...
atis
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CRE...
SELECT YEAR(c.CreationDate), COUNT(c.Id) FROM Comments AS c WHERE c.Text LIKE '%codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question%' GROUP BY YEAR(c.CreationDate) ORDER BY COUNT(c.Id) DESC
sede
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text,...
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 = 'NEWARK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CLEVELA...
atis
CREATE TABLE table_75992 ( "Source" text, "Date" text, "Goberman" text, "Loera" text, "Merkley" text, "Neville" text, "Novick" text, "Obrist" text, "Other/ Undecided" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Goberman has ...
SELECT "Goberman" FROM table_75992 WHERE "Obrist" = '2%' AND "Merkley" = '34%'
wikisql
CREATE TABLE table_name_52 ( gp_gs VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the GP-GS for the 2009 season?
SELECT gp_gs FROM table_name_52 WHERE season = "2009"
sql_create_context
CREATE TABLE table_63369 ( "Title" text, "Series" text, "Director" text, "Production Number" text, "Release date" text, "reissue?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the release date of the feature with a production number o...
SELECT "Release date" FROM table_63369 WHERE "Production Number" = '1018, br 1352'
wikisql
CREATE TABLE table_65554 ( "Year" real, "Game" text, "Genre" text, "Platform(s)" text, "Developer(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the developer(s) of the genre Adventure?
SELECT "Developer(s)" FROM table_65554 WHERE "Genre" = 'adventure'
wikisql
CREATE TABLE table_name_6 ( gold INTEGER, bronze INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of gold medals with more than 1 bronze medal?
SELECT AVG(gold) FROM table_name_6 WHERE bronze > 1
sql_create_context
CREATE TABLE table_8098 ( "Name" text, "Built" text, "Listed" text, "Location" text, "County" text, "Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the listed date of the Warren pony truss bridge that was built in 1925?
SELECT "Listed" FROM table_8098 WHERE "Built" = '1925' AND "Type" = 'warren pony truss'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT zyjzjlb.CYKSDM, zyjzjlb.CYKSMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '63852370020'
css
CREATE TABLE table_52582 ( "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. -- Name the date that had a score of 7 6(4), 6 1
SELECT "Date" FROM table_52582 WHERE "Score" = '7–6(4), 6–1'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2108" AND lab.itemid = "50998"
mimicsql_data
CREATE TABLE table_18071 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the origina...
SELECT "Original air date" FROM table_18071 WHERE "Written by" = 'Vanessa Reisen'
wikisql
CREATE TABLE table_49981 ( "Name" text, "Built" text, "Listed" text, "Location" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location of the Bridge Built in 1869?
SELECT "Location" FROM table_49981 WHERE "Built" = '1869'
wikisql
CREATE TABLE scientists ( ssn number, name text ) CREATE TABLE projects ( code text, name text, hours number ) CREATE TABLE assignedto ( scientist number, project text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many scientists are there...
SELECT COUNT(*) FROM scientists
spider
CREATE TABLE table_41380 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the first leg score for the match that had a 0-2 2nd leg score?
SELECT "1st leg" FROM table_41380 WHERE "2nd leg" = '0-2'
wikisql
CREATE TABLE table_name_72 ( crowd INTEGER, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When carlton was the home team what was the lowest crowd turnout?
SELECT MIN(crowd) FROM table_name_72 WHERE home_team = "carlton"
sql_create_context
CREATE TABLE table_65286 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Silver has a Rank of 4, and a Bronze smaller than 12?
SELECT COUNT("Silver") FROM table_65286 WHERE "Rank" = '4' AND "Bronze" < '12'
wikisql
CREATE TABLE table_55866 ( "CERCLIS ID" text, "Name" text, "County" text, "Proposed" text, "Listed" text, "Construction completed" text, "Partially deleted" text, "Deleted" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Prop...
SELECT "Proposed" FROM table_55866 WHERE "CERCLIS ID" = 'al0001058056'
wikisql
CREATE TABLE table_74554 ( "Latin Letter" text, "Code Abbr." text, "Local letter" text, "Code Name" text, "Official Name" text, "Capital" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The capital of funadhoo has what local letter?
SELECT "Local letter" FROM table_74554 WHERE "Capital" = 'funadhoo'
wikisql
CREATE TABLE table_60014 ( "Provider" text, "Years" text, "Free or pay" text, "Transmission" text, "On demand" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which On demand has a pay and a Provider of virgin media (formerly ntl:telewest)?
SELECT "On demand" FROM table_60014 WHERE "Free or pay" = 'pay' AND "Provider" = 'virgin media (formerly ntl:telewest)'
wikisql
CREATE TABLE table_name_55 ( name VARCHAR, acquisition_via VARCHAR, number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the player acquired via import and larger than 22?
SELECT name FROM table_name_55 WHERE acquisition_via = "import" AND number > 22
sql_create_context
CREATE TABLE table_26857 ( "Name of Award" text, "Name of Film" text, "Language" text, "Awardee(s)" text, "Cash Prize" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the awardee for best editing
SELECT "Awardee(s)" FROM table_26857 WHERE "Name of Award" = 'Best Editing'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT demographic.age, demographic.language FROM demographic WHERE demographic.name = "Francis Baseler"
mimicsql_data
CREATE TABLE department ( dept_name VARCHAR, budget VARCHAR ) CREATE TABLE instructor ( salary INTEGER, dept_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number and averaged salary of all instructors who are in the department with th...
SELECT AVG(T1.salary), COUNT(*) FROM instructor AS T1 JOIN department AS T2 ON T1.dept_name = T2.dept_name ORDER BY T2.budget DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_62 ( laps INTEGER, driver VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest laps driver Christian Vietoris with a grid smaller than 6 has?
SELECT MIN(laps) FROM table_name_62 WHERE driver = "christian vietoris" AND grid < 6
sql_create_context
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 WHERE demographic.diagnosis = "CONGESTIVE HEART FAILURE" AND demographic.admityear < "2155"
mimicsql_data
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, ...
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 40 AND 49) GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_10092 ( "Number" real, "Name" text, "Year Built" text, "Boat Builder" text, "Current Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What boat builder built the valmai with a number less than 65?
SELECT "Boat Builder" FROM table_10092 WHERE "Number" < '65' AND "Name" = 'valmai'
wikisql
CREATE TABLE table_33763 ( "Team" text, "Chassis" text, "Engine" text, "Driver(s)" text, "Sponsor(s)" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which rounds do Arciero Wines sponsor a March 85c chassis?
SELECT "Rounds" FROM table_33763 WHERE "Sponsor(s)" = 'arciero wines' AND "Chassis" = 'march 85c'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE table_name_45 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team score at lake oval?
SELECT home_team AS score FROM table_name_45 WHERE venue = "lake oval"
sql_create_context
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_na...
SELECT DISTINCT airport_service.miles_distant FROM airport, airport_service, city WHERE airport.airport_code = 'MCO' AND airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'ORLANDO'
atis
CREATE TABLE table_name_43 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the game where Geelong was the away team?
SELECT date FROM table_name_43 WHERE away_team = "geelong"
sql_create_context
CREATE TABLE table_16887 ( "Year" real, "Location" text, "1st Place" text, "2nd Place" text, "3rd Place" text, "4th Place" text, "5th Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school took 4th place in 2001?
SELECT "4th Place" FROM table_16887 WHERE "Year" = '2001'
wikisql
CREATE TABLE table_69127 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Money ($) of the game with a score of 69-74-70-73=286?
SELECT MAX("Money ( $ )") FROM table_69127 WHERE "Score" = '69-74-70-73=286'
wikisql
CREATE TABLE table_1911 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how...
SELECT COUNT("Pop. (2010)") FROM table_1911 WHERE "Water (sqmi)" = '0.818'
wikisql
CREATE TABLE table_67052 ( "Quarter" text, "Score" text, "Club" text, "Opponent" text, "Year" text, "Round" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent has a Round of 12?
SELECT "Opponent" FROM table_67052 WHERE "Round" = '12'
wikisql
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZ...
SELECT mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND per...
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod tim...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE table_20236726_2 ( wd_no VARCHAR, lms_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of wd number for lms number being 7638
SELECT COUNT(wd_no) FROM table_20236726_2 WHERE lms_no = 7638
sql_create_context
CREATE TABLE table_63650 ( "Minister" text, "Party" text, "Governments" text, "Term start" text, "Term end" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the term start date for Meretz?
SELECT "Term start" FROM table_63650 WHERE "Party" = 'meretz'
wikisql
CREATE TABLE table_name_21 ( winner VARCHAR, trainer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What horse won with a trainer of 'no race'?
SELECT winner FROM table_name_21 WHERE trainer = "no race"
sql_create_context
CREATE TABLE table_25216791_3 ( january_15_16 VARCHAR, august_21_22 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many datas were recorded on January 15-16 if August 21-22 is 155?
SELECT COUNT(january_15_16) FROM table_25216791_3 WHERE august_21_22 = "155"
sql_create_context
CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of...
SELECT Name, Market_Rate FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte) ORDER BY Name
nvbench
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 jybgb.SHSJ FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '蒋...
css
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) ...
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIM...
atis
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(t_kc21.MED_SER_ORG_NO) FROM t_kc21 WHERE t_kc21.PERSON_NM = '周雅韶' AND t_kc21.IN_HOSP_DATE BETWEEN '2015-04-12' AND '2020-11-25'
css
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( ...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-23115')) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(...
eicu
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_MED_ORG_DEPT_NM FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '1368313' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-02-22' AND '2005-11-03' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 26
css
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.CLINIC_ID FROM qtb WHERE qtb.MED_CLINIC_ID = '34573036541' UNION SELECT gyb.CLINIC_ID FROM gyb WHERE gyb.MED_CLINIC_ID = '34573036541' UNION SELECT zyb.CLINIC_ID FROM zyb WHERE zyb.MED_CLINIC_ID = '34573036541' UNION SELECT mzb.CLINIC_ID FROM mzb WHERE mzb.MED_CLINIC_ID = '34573036541'
css
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.PERSON_ID = '86374331' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-12-13' AND '2015-01-23'
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Malignant neoplasm of other sites of tongue" AND prescriptions.drug_type = "BASE"
mimicsql_data
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(Height) FROM people GROUP BY Sex ORDER BY SUM(Height)
nvbench
CREATE TABLE table_204_198 ( id number, "club" text, "nickname" text, "no. of premierships" number, "premiership years" text, "moved to" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which two clubs have no nickname listed ?
SELECT "club" FROM table_204_198 WHERE "nickname" IS NULL
squall
CREATE TABLE table_77425 ( "Year" real, "Player" text, "Position" text, "Nationality" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the nationality of Montreal Impact with Justin Mapp Category:articles with hcards as the player?...
SELECT "Nationality" FROM table_77425 WHERE "Team" = 'montreal impact' AND "Player" = 'justin mapp category:articles with hcards'
wikisql
CREATE TABLE table_66459 ( "District" text, "s Barangay" real, "Population (2010 census)" real, "Area ( has .)" real, "Pop. density (per km2)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of Barangay with an area larger than 865....
SELECT SUM("s Barangay") FROM table_66459 WHERE "Area ( has .)" > '865.13'
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 hz_info ( KH text, KLX number...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '87197835' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2013-01-25')
css
CREATE TABLE table_39294 ( "Season" text, "Club" text, "Country" text, "Competition" text, "Caps" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest caps for the Club of SBV Excelsior?
SELECT MIN("Caps") FROM table_39294 WHERE "Club" = 'sbv excelsior'
wikisql