instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE days ( days_code varchar, day_name varchar ) 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, departur...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.airline_code = 'CO') OR flight.airline_code = 'DL') OR (flight.airline_code = 'TW')) AND ((CITY_1.city_code = AIRPORT_SERVICE_1.city_co...
atis
CREATE TABLE table_34534 ( "Name" text, "Town/City" text, "Borough" text, "Region" text, "Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Borough is the Anchorage museum of Natural History?
SELECT "Name" FROM table_34534 WHERE "Borough" = 'anchorage' AND "Type" = 'natural history'
wikisql
CREATE TABLE table_68052 ( "Name" text, "Years" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the roll number of Orautoha school in Raetihi, which has a decile smaller than 8?
SELECT SUM("Roll") FROM table_68052 WHERE "Area" = 'raetihi' AND "Name" = 'orautoha school' AND "Decile" < '8'
wikisql
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '2121304' AND jybgb.BGRQ BETWEEN '2004-12-03' AND '2010-02-06' GROUP BY jybgb.KSBM HAVING COUNT(*) > 21) AS T
css
CREATE TABLE table_name_41 ( time_retired VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time/retired of the car that started in grid 4?
SELECT time_retired FROM table_name_41 WHERE grid = "4"
sql_create_context
CREATE TABLE table_16396 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What CFL teams are part of Simon Fraser college?
SELECT "CFL Team" FROM table_16396 WHERE "College" = 'Simon Fraser'
wikisql
CREATE TABLE table_44564 ( "Coach" text, "Years" text, "Win-Loss" text, "Win %" text, "Conference Titles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Coach, when Win % is .352?
SELECT "Coach" FROM table_44564 WHERE "Win %" = '.352'
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '74125080' AND t_kc22.STA_DATE BETWEEN '2017-12-05' AND '2018-03-20' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC L...
css
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%pakistan%' OR UPPER(Location) LIKE '%PK' ORDER BY Reputation DESC LIMIT 5
sede
CREATE TABLE table_11869952_1 ( derivatives VARCHAR, rocket_launch VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which authority has a rocket launch called rehbar-5?
SELECT COUNT(derivatives) FROM table_11869952_1 WHERE rocket_launch = "Rehbar-5"
sql_create_context
CREATE TABLE table_4211 ( "Player" text, "Starts" real, "Cuts made" real, "Best finish" text, "Money list rank" text, "Earnings ($)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which money list ranks had a best finish of 2?
SELECT COUNT("Money list rank") FROM table_4211 WHERE "Best finish" = '2'
wikisql
CREATE TABLE table_51462 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the driver with 29 laps?
SELECT "Driver" FROM table_51462 WHERE "Laps" = '29'
wikisql
CREATE TABLE table_73025 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Time Frame" text, "Starring Actors" text, "Theme Song(s)" text, "Episodes" real, "Average Ratings" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT "Japanese Title" FROM table_73025 WHERE "TV Station" = 'TV Asahi'
wikisql
CREATE TABLE table_7711 ( "Draw" real, "Artist" text, "Song" text, "Televote" real, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a draw greater than 11 and the place smaller than 4 what was the televote?
SELECT "Televote" FROM table_7711 WHERE "Draw" > '11' AND "Place" < '4'
wikisql
CREATE TABLE table_203_778 ( id number, "representative" text, "title" text, "presentation\nof credentials" text, "termination\nof mission" text, "appointed by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which ambassador to honduras served t...
SELECT "representative" FROM table_203_778 ORDER BY "termination\nof mission" - "presentation\nof credentials" DESC LIMIT 1
squall
CREATE TABLE table_65030 ( "Party" text, "Burnley" real, "Chorley" real, "Fylde" real, "Hyndburn" real, "Lancaster" real, "Pendle" real, "Preston" real, "Ribble Valley" real, "Rossendale" real, "South Ribble" real, "West Lancashire" real, "Wyre" real, "Total" real...
SELECT AVG("Fylde") FROM table_65030 WHERE "Burnley" < '0'
wikisql
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 varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JO...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY SUM(SALARY)
nvbench
CREATE TABLE table_name_13 ( laps INTEGER, driver VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps for denny hulme with under 4 on the grid?
SELECT SUM(laps) FROM table_name_13 WHERE driver = "denny hulme" AND grid < 4
sql_create_context
CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40), other_det...
SELECT lot_details, COUNT(lot_details) FROM Lots GROUP BY lot_details ORDER BY lot_details DESC
nvbench
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Descrip...
SELECT p.Id AS "post_link" FROM Posts AS p JOIN Comments AS c ON c.PostId = p.Id WHERE DATEDIFF(day, p.LastEditDate, CreationDate) >= 0 AND c.Text LIKE '%##KeywordsInComment##%' AND NOT EXISTS(SELECT ph.PostId FROM PostHistory AS ph WHERE ph.PostHistoryTypeId = 10 AND ph.PostId = p.Id) GROUP BY p.Id ORDER BY p.Id DESC
sede
CREATE TABLE table_75264 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the second who has Caroline Reed as third?
SELECT "Second" FROM table_75264 WHERE "Third" = 'caroline reed'
wikisql
CREATE TABLE table_23436 ( "Episode" text, "First broadcast" text, "Rufus guest" text, "Marcus guest" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the winner for jason byrne
SELECT "Winner" FROM table_23436 WHERE "Marcus guest" = 'Jason Byrne'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Primary apnea of newborn" AND prescriptions.route = "DWELL"
mimicsql_data
CREATE TABLE table_63718 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district has a constituency of 60?
SELECT "District" FROM table_63718 WHERE "Constituency number" = '60'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "NEB"
mimicsql_data
CREATE TABLE table_name_13 ( virtue VARCHAR, acedia VARCHAR, latin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which virtue is acedia(Latin)?
SELECT virtue FROM table_name_13 WHERE (latin) = acedia
sql_create_context
CREATE TABLE table_14270 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what lane did the swimmer get a time of 1:59.42?
SELECT SUM("Lane") FROM table_14270 WHERE "Time" = '1:59.42'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51457"
mimicsql_data
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 * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN 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 = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_31183 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Featured character(s)" text, "U.S. viewers (millions)" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people dire...
SELECT COUNT("Directed by") FROM table_31183 WHERE "No." = '2'
wikisql
CREATE TABLE table_3019 ( "Overall" real, "No. in series" real, "Title" text, "Directed by" text, "Original air date" text, "U.S. viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did the episode that had 1.023 mill...
SELECT "Original air date" FROM table_3019 WHERE "U.S. viewers (in millions)" = '1.023'
wikisql
CREATE TABLE takes ( id text, course_id text, sec_id text, semester text, year number, grade text ) CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE section ( course_id text, sec_id text, semester text, y...
SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND year = 2003)
spider
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-101426')) AND intakeoutput.cellpath LIKE '%output%' AND ...
eicu
CREATE TABLE table_58772 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Location, when Opponent is 'Mario Rinaldi'?
SELECT "Location" FROM table_58772 WHERE "Opponent" = 'mario rinaldi'
wikisql
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT JYSQJGMC, JYJGMC FROM jybgb WHERE BGDH = '98041595425'
css
CREATE TABLE table_45927 ( "Outcome" text, "Year" real, "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. -- Which Surface has an Opponent in the final of don mcne...
SELECT "Surface" FROM table_45927 WHERE "Opponent in the final" = 'don mcneill' AND "Year" = '1940'
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "481" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_203_79 ( id number, "year" number, "film" text, "publisher" text, "director" text, "distributor" text, "worldwide gross" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which live action american superhero...
SELECT "film" FROM table_203_79 WHERE "year" < 1966
squall
CREATE TABLE table_74166 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who ha...
SELECT "High rebounds" FROM table_74166 WHERE "Date" = 'December 12'
wikisql
CREATE TABLE table_27286 ( "Model" text, "Power" text, "Torque" text, "Gearbox" text, "Weight" text, "Seating" text, "Brakes" text, "Wheels" text, "Tyres" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the power for the Spiri...
SELECT "Power" FROM table_27286 WHERE "Model" = 'Spirit R (Type B)'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Pseudomonas infect NOS"
mimicsql_data
CREATE TABLE table_name_91 ( tonnage VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the tonnage on 12 september 1942?
SELECT tonnage FROM table_name_91 WHERE date = "12 september 1942"
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2043" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Posts ( Id nu...
SELECT COUNT(DISTINCT p.AcceptedAnswerId), p2.OwnerUserId FROM Posts AS p, Posts AS p2 GROUP BY p2.OwnerUserId ORDER BY COUNT(DISTINCT p.AcceptedAnswerId) DESC
sede
CREATE TABLE table_37324 ( "District" real, "Incumbent" text, "2008 Status" text, "Democratic" text, "Republican" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Democratic has a District smaller than 7, and a Republican of dan mansell?
SELECT "Democratic" FROM table_37324 WHERE "District" < '7' AND "Republican" = 'dan mansell'
wikisql
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average age for...
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY job DESC
nvbench
CREATE TABLE table_name_75 ( time VARCHAR, method VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time of the match with a record of 9-0 and used the tko (doctor stoppage) method?
SELECT time FROM table_name_75 WHERE method = "tko (doctor stoppage)" AND record = "9-0"
sql_create_context
CREATE TABLE table_name_47 ( athlete VARCHAR, run_1 VARCHAR, run_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the athlete with a run 1 less than 54.13 and a 55.21 run 3?
SELECT athlete FROM table_name_47 WHERE run_1 < 54.13 AND run_3 = 55.21
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 demographic ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA"
mimicsql_data
CREATE TABLE table_22815 ( "Episode title" text, "Subject" text, "Music by" text, "Lyrics by" text, "Performed by" text, "First aired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date for the episode performed by Sue Manchester?
SELECT "First aired" FROM table_22815 WHERE "Performed by" = 'Sue Manchester'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId ...
SELECT Id FROM Posts WHERE ViewCount = 9999
sede
CREATE TABLE table_name_29 ( game VARCHAR, result VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games have a Result of 4 0, and an Attendance larger than 12,256?
SELECT COUNT(game) FROM table_name_29 WHERE result = "4–0" AND attendance > 12 OFFSET 256
sql_create_context
CREATE TABLE table_4819 ( "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. -- On what date was the match played in Victoria Par...
SELECT "Date" FROM table_4819 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE table_204_755 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many games did this team win this season ?
SELECT COUNT(*) FROM table_204_755 WHERE "result" = 'w'
squall
CREATE TABLE table_name_64 ( team VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the team when the driver is viktor jensen?
SELECT team FROM table_name_64 WHERE driver = "viktor jensen"
sql_create_context
CREATE TABLE table_name_26 ( year VARCHAR, movie_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was Jamboree made?
SELECT year FROM table_name_26 WHERE movie_title = "jamboree"
sql_create_context
CREATE TABLE table_name_28 ( nation VARCHAR, silver VARCHAR, bronze VARCHAR, gold VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Nation has a Gold entry that is greater than 0, a Total that is greater than 2, a Silver entry th...
SELECT nation FROM table_name_28 WHERE gold > 0 AND total > 2 AND bronze = 0 AND silver > 1
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2138" AND procedures.icd9_code = "5781"
mimicsql_data
CREATE TABLE table_73727 ( "Stage" real, "Winner" text, "General Classification" text, "Youth Classification" text, "Mountains Classification" text, "Sprint Classification" text, "Most Courageous" text, "Team Classification" text ) -- Using valid SQLite, answer the following questions ...
SELECT "Sprint Classification" FROM table_73727 WHERE "Mountains Classification" = 'Ryan Anderson' AND "General Classification" = 'Michael Rogers'
wikisql
CREATE TABLE table_203_180 ( id number, "#" number, "weekend end date" text, "film" text, "weekend gross (millions)" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many films grossed over five million in their first week ?
SELECT COUNT(DISTINCT "film") FROM table_203_180 WHERE "weekend gross (millions)" > 5
squall
CREATE TABLE table_name_56 ( year INTEGER, artist VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the first year that the artist of every little thing ranked lower than 10?
SELECT MIN(year) FROM table_name_56 WHERE artist = "every little thing" AND rank < 10
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '5573688' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 28 UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_k...
css
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dis...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE table_27716091_1 ( directed_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who put on the show where the numbers were 227412
SELECT directed_by FROM table_27716091_1 WHERE production_code = 227412
sql_create_context
CREATE TABLE table_name_75 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance on may 21?
SELECT MAX(attendance) FROM table_name_75 WHERE date = "may 21"
sql_create_context
CREATE TABLE table_6926 ( "Office" text, "Democratic ticket" text, "Republican ticket" text, "Conservative ticket" text, "Liberal ticket" text, "Free Libertarian ticket" text, "Socialist Labor ticket" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT "Democratic ticket" FROM table_6926 WHERE "Office" = 'u.s. senator'
wikisql
CREATE TABLE table_19117 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the follo...
SELECT "Won" FROM table_19117 WHERE "Points for" = '643'
wikisql
CREATE TABLE table_name_89 ( laps VARCHAR, grid VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Laps Did Driver David Coulthard have on a Grid smaller than 11?
SELECT laps FROM table_name_89 WHERE grid < 11 AND driver = "david coulthard"
sql_create_context
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 person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jy...
css
CREATE TABLE table_name_61 ( races INTEGER, points VARCHAR, poles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average races when points is 9 and poles is less than 0?
SELECT AVG(races) FROM table_name_61 WHERE points = "9" AND poles < 0
sql_create_context
CREATE TABLE table_37520 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the report for the t...
SELECT "Report" FROM table_37520 WHERE "Ground" = 'mcg' AND "Home team score" = '6.5 (41)'
wikisql
CREATE TABLE table_name_45 ( company VARCHAR, country VARCHAR, author VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the company from Greece with author Aeschylus?
SELECT company FROM table_name_45 WHERE country = "greece" AND author = "aeschylus"
sql_create_context
CREATE TABLE table_name_65 ( winnings VARCHAR, points VARCHAR, make VARCHAR, car__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the winnings for the Chevrolet with a number larger than 29 and scored 102 points?
SELECT winnings FROM table_name_65 WHERE make = "chevrolet" AND car__number > 29 AND points = 102
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date...
SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE projects ( code VARCHAR, name VARCHAR ) CREATE TABLE scientists ( name VARCHAR, SSN VARCHAR ) CREATE TABLE assignedto ( project VARCHAR, scientist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of the scientist wh...
SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'A Pu...
sql_create_context
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fli...
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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'A...
atis
CREATE TABLE table_name_32 ( round VARCHAR, method VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round has a Method of decision (unanimous), and an Event of ufc 145?
SELECT round FROM table_name_32 WHERE method = "decision (unanimous)" AND event = "ufc 145"
sql_create_context
CREATE TABLE table_80179 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the start of the race with 676 laps?
SELECT "Start" FROM table_80179 WHERE "Laps" = '676'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTask...
SELECT SUBSTRING(Comment, CHARINDEX('//', Comment) + 2, CHARINDEX('.com', Comment) - CHARINDEX('//', Comment) + 2) AS "sentto", COUNT(Id) AS "count" FROM PostHistory WHERE PostHistoryTypeId = 35 AND CreationDate >= DATEADD(dd, -365 * 2, GETDATE()) GROUP BY SUBSTRING(Comment, CHARINDEX('//', Comment) + 2, CHARINDEX('.co...
sede
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 259...
mimic_iii
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p hysterectomy - abdominal' AND DATETIME(diagnosis...
eicu
CREATE TABLE table_9342 ( "Episode" text, "7 Deadly Sin" text, "Challenge Winner" text, "Challenge Loser" text, "Voted In To 'El Duelo'" text, "Eliminated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which winner has a Challenge Loser of alex...
SELECT "Challenge Winner" FROM table_9342 WHERE "Challenge Loser" = 'alexcy'
wikisql
CREATE TABLE table_29376 ( "No. in Series" real, "No. in Season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highes...
SELECT MAX("No. in Series") FROM table_29376 WHERE "U.S. viewers (millions)" = '9.17'
wikisql
CREATE TABLE table_14058433_5 ( won VARCHAR, points_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the won with points for being 643
SELECT won FROM table_14058433_5 WHERE points_for = "643"
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 OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_ID = '78376442' AND IN_HOSP_DATE BETWEEN '2003-06-30' AND '2019-07-06' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
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.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.PERSON_ID = '18482943' GROUP BY qtb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.PERSON_ID = '18482943' GROUP BY gyb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT zyb.OUT_DIAG_DOC_...
css
CREATE TABLE table_40130 ( "Office" text, "Republican ticket" text, "Democratic ticket" text, "Socialist ticket" text, "Prohibition ticket" text, "Progressive ticket" text, "Independence League ticket" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "Prohibition ticket" FROM table_40130 WHERE "Progressive ticket" = 'eugene m. travis'
wikisql
CREATE TABLE table_24501 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was James P. Buchanan (d)'s successor seated?
SELECT "Date successor seated" FROM table_24501 WHERE "Vacator" = 'James P. Buchanan (D)'
wikisql
CREATE TABLE table_16751596_2 ( republican VARCHAR, dates_administered VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the republican steve sauerberg where dates administered september 15-september 18, 2008
SELECT republican AS :_steve_sauerberg FROM table_16751596_2 WHERE dates_administered = "September 15-September 18, 2008"
sql_create_context
CREATE TABLE table_80151 ( "Year" text, "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. -- What year did Carolina Marin win the Women's singl...
SELECT "Year" FROM table_80151 WHERE "Women's singles" = 'carolina marin'
wikisql
CREATE TABLE table_204_659 ( id number, "seat" text, "state" text, "majority" number, "member" text, "party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many members in total ?
SELECT COUNT("member") FROM table_204_659
squall
CREATE TABLE table_name_80 ( opponent VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the opponent with loss of sanderson (9-8)
SELECT opponent FROM table_name_80 WHERE loss = "sanderson (9-8)"
sql_create_context
CREATE TABLE table_204_941 ( id number, "#" number, "date" text, "visitor" text, "score" text, "home" text, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in how many games did one of the teams score below 100 points ?
SELECT COUNT(*) FROM table_204_941 WHERE "score" < 100 OR "score" < 100
squall
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '79465357479'
css
CREATE TABLE table_26292 ( "Bowl Game" text, "Date" text, "Stadium" text, "City" text, "Television" text, "Matchup/Results" text, "Attendance" real, "Payout (US$)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different items a...
SELECT COUNT("Television") FROM table_26292 WHERE "Matchup/Results" = 'Iowa State 14, Minnesota 13'
wikisql
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE venue ( venueid int, venuename var...
SELECT DISTINCT dataset.datasetid FROM dataset, paper, paperdataset, venue WHERE paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid AND venue.venueid = paper.venueid AND venue.venuename = 'ACL'
scholar
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 jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '78828339' AND jybgb.BGRQ BETWEEN '2004-07-28' AND '2006-...
css
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 real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Name, Weight FROM people ORDER BY Weight
nvbench
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 WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.days_stay > "23"
mimicsql_data
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varc...
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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLANDO' AND fare.round_trip_required = 'NO' AND flight_fare.fare_id =...
atis