instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_2104 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What NHL team did jim koleff play on?
SELECT "NHL team" FROM table_2104 WHERE "Player" = 'Jim Koleff'
wikisql
CREATE TABLE table_204_683 ( id number, "no." number, "constituency" text, "winner candidate" text, "party" text, "votes" number, "margin" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which party had the most candidates win in this elect...
SELECT "party" FROM table_204_683 GROUP BY "party" ORDER BY COUNT("winner candidate") DESC LIMIT 1
squall
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_CD = '030' AND IN_HOSP_DATE BETWEEN '2000-09-21' AND '2018-01-31' AND IN_DIAG_DIS_NM = '沙眼' AND CLINIC_TYPE = '住院'
css
CREATE TABLE table_204_54 ( id number, "pondicherry assembly" text, "duration" text, "name of m.l.a." text, "party affiliation" text, "election year" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- is the current pondicherry assembly the tenth ...
SELECT "pondicherry assembly" FROM table_204_54 ORDER BY "duration" DESC LIMIT 1
squall
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( ro...
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 15821 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.dischtime DESC LIMIT 1
mimic_iii
CREATE TABLE table_24440361_1 ( kurdistan_democratic_party INTEGER, total_kurdistan_list VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the kurdistan democratic party for kurdistan list being 10
SELECT MIN(kurdistan_democratic_party) FROM table_24440361_1 WHERE total_kurdistan_list = 10
sql_create_context
CREATE TABLE table_28547332_4 ( matches INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum number of matches in a game?
SELECT MAX(matches) FROM table_28547332_4
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 HOSP_DOC_CD, HOSP_DOC_NM FROM t_kc22 WHERE MED_CLINIC_ID = '65324630135'
css
CREATE TABLE table_80293 ( "Year" real, "Builder" text, "Type" text, "LB&SCR No." text, "SR No." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the LB&SCR number that has SR number of 8597 8600
SELECT "LB&SCR No." FROM table_80293 WHERE "SR No." = '8597–8600'
wikisql
CREATE TABLE table_name_36 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2012 for us open
SELECT 2012 FROM table_name_36 WHERE tournament = "us open"
sql_create_context
CREATE TABLE table_47938 ( "Tournament" text, "Country" text, "Location" text, "Current Venue" text, "Began" real, "Court surface" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the surface played on for the match than began before 1897...
SELECT "Court surface" FROM table_47938 WHERE "Began" < '1897'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" AND procedures.icd9_code = "9229"
mimicsql_data
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 * FROM Users WHERE Location LIKE '%Sri Lanka%' ORDER BY Reputation DESC
sede
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
SELECT jyjgzbb.JYZBLSH 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...
css
CREATE TABLE table_43321 ( "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. -- What i...
SELECT "Team" FROM table_43321 WHERE "Score" = 'l 79–92 (ot)'
wikisql
CREATE TABLE table_204_431 ( id number, "yacht" text, "nation" text, "owner" text, "skipper" text, "launch year" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- its alan whiteley yacht 's name dehler magic
SELECT (SELECT "yacht" FROM table_204_431 WHERE "owner" = 'alan whiteley') = 'dehler magic'
squall
CREATE TABLE table_13115 ( "Shooter" text, "Event" text, "Rank points" text, "Score points" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event did the shooter, who had 29 total points, compete in?
SELECT "Event" FROM table_13115 WHERE "Total" = '29'
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.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Price
nvbench
CREATE TABLE table_name_28 ( man_of_the_match VARCHAR, venue VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Man of the Match when they played the Romford Raiders at home?
SELECT man_of_the_match FROM table_name_28 WHERE venue = "home" AND opponent = "romford raiders"
sql_create_context
CREATE TABLE lots ( lot_id number, investor_id number, lot_details text ) CREATE TABLE purchases ( purchase_transaction_id number, purchase_details text ) CREATE TABLE ref_transaction_types ( transaction_type_code text, transaction_type_description text ) CREATE TABLE sales ( sales_tr...
SELECT date_of_transaction FROM transactions WHERE transaction_type_code = "SALE"
spider
CREATE TABLE table_25352 ( "County" text, "Population" real, "Unemployment Rate" text, "Market Income Per Capita" text, "Poverty Rate" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status if the poverty rate is 11.4%?...
SELECT "Status" FROM table_25352 WHERE "Poverty Rate" = '11.4%'
wikisql
CREATE TABLE table_11960944_4 ( date VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date was the team playing @ Memphis?
SELECT date FROM table_11960944_4 WHERE team = "@ Memphis"
sql_create_context
CREATE TABLE table_59637 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has an Event of 4x400 m relay, and a Venue of stuttgart , germany?
SELECT "Position" FROM table_59637 WHERE "Event" = '4x400 m relay' AND "Venue" = 'stuttgart , germany'
wikisql
CREATE TABLE table_name_96 ( league VARCHAR, sport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of a league in the sport of baseball?
SELECT league FROM table_name_96 WHERE sport = "baseball"
sql_create_context
CREATE TABLE table_77465 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score of the Pittsburgh Home game on March 3 with 61 Poi...
SELECT "Score" FROM table_77465 WHERE "Home" = 'pittsburgh' AND "Points" = '61' AND "Date" = 'march 3'
wikisql
CREATE TABLE film ( film_id number, rank_in_series number, number_in_season number, title text, directed_by text, original_air_date text, production_code text ) CREATE TABLE cinema ( cinema_id number, name text, openning_year number, capacity number, location text ) CRE...
SELECT COUNT(*) FROM film WHERE title LIKE "%Dummy%"
spider
CREATE TABLE table_72368 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district is nick lampson from?
SELECT "District" FROM table_72368 WHERE "Incumbent" = 'Nick Lampson'
wikisql
CREATE TABLE table_73353 ( "Year" real, "Starts" real, "Wins" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Team(s)" FROM table_73353 WHERE "Avg. Finish" = '23.3'
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 WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "COLANGITIS"
mimicsql_data
CREATE TABLE table_19936 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the series ep for s02e08
SELECT "Series Ep." FROM table_19936 WHERE "Netflix" = 'S02E08'
wikisql
CREATE TABLE College ( enr INTEGER, state VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is average enrollment of colleges in the state FL?
SELECT AVG(enr) FROM College WHERE state = 'FL'
sql_create_context
CREATE TABLE table_12936 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of a grid for driver Patrick Carpentier and less than 103 laps?
SELECT SUM("Grid") FROM table_12936 WHERE "Driver" = 'patrick carpentier' AND "Laps" < '103'
wikisql
CREATE TABLE table_name_89 ( score VARCHAR, visitor VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for toronto visitor and record of 29-17-8
SELECT score FROM table_name_89 WHERE visitor = "toronto" AND record = "29-17-8"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number...
SELECT u.Id AS "user_link", SUM(p.Score) AS ReactScore, u.Reputation, u.Location FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE (LOWER(Location) LIKE '%pakistan%' OR UPPER(Location) LIKE '%PK') AND p.Tags LIKE '%java%' GROUP BY u.Id, u.Reputation, u.Location ORDER BY ReactScore DESC LIMIT 100
sede
CREATE TABLE table_44541 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Player is Billy Mayfair?
SELECT "Score" FROM table_44541 WHERE "Player" = 'billy mayfair'
wikisql
CREATE TABLE table_33292 ( "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 is the average crowd size at all matches wh...
SELECT AVG("Crowd") FROM table_33292 WHERE "Home team score" = '6.12 (48)'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
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 = '56819536' AND t_kc22.STA_DATE BETWEEN '2006-11-26' AND '2021-01-02' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.short_title = "Dysthymic disorder"
mimicsql_data
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 COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE MED_SER_ORG_NO = '6747187' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')
css
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 mzjzjlb.SG, mzjzjlb.TZ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND 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...
css
CREATE TABLE table_name_61 ( top_10 INTEGER, tournament VARCHAR, top_25 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of top-10 values for the Open Championship and less than 3 in the top-25?
SELECT SUM(top_10) FROM table_name_61 WHERE tournament = "the open championship" AND top_25 < 3
sql_create_context
CREATE TABLE table_name_94 ( prize_money___$__ VARCHAR, country VARCHAR, rank VARCHAR, events VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What amount of prize money was there when the rank was less than 7, there were more than 6 events, and the co...
SELECT prize_money___$__ FROM table_name_94 WHERE rank < 7 AND events > 6 AND country = "fiji"
sql_create_context
CREATE TABLE table_23284271_10 ( high_points VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has the high points when 53-27 is the record?
SELECT high_points FROM table_23284271_10 WHERE record = "53-27"
sql_create_context
CREATE TABLE table_16729063_1 ( pick__number VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many draft picks are there at the Defensive End position?
SELECT COUNT(pick__number) FROM table_16729063_1 WHERE position = "Defensive End"
sql_create_context
CREATE TABLE table_name_32 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What dates contained matches at the venue Bourda?
SELECT date FROM table_name_32 WHERE venue = "bourda"
sql_create_context
CREATE TABLE table_56567 ( "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 is the name of the away team that played a ...
SELECT "Away team" FROM table_56567 WHERE "Home team score" = '11.16 (82)'
wikisql
CREATE TABLE table_60663 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player has a score of 68-69-73=210
SELECT "Player" FROM table_60663 WHERE "Score" = '68-69-73=210'
wikisql
CREATE TABLE field ( fieldid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, ...
SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'ohad shamir' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citedpaperid) DESC
scholar
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Stevens-Johnson-TEN syn" AND prescriptions.route = "PB"
mimicsql_data
CREATE TABLE table_32401 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent, before Week 10, had an attendance of 63,672?
SELECT "Opponent" FROM table_32401 WHERE "Week" < '10' AND "Attendance" = '63,672'
wikisql
CREATE TABLE table_60468 ( "Class" text, "Seas" text, "1st GP" text, "1st Pod" text, "1st Win" text, "Race" real, "Podiums" real, "Pole" real, "FLap" real, "WChmp" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highes...
SELECT MAX("FLap") FROM table_60468 WHERE "Class" = '500 cc'
wikisql
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 age, 'posttypeid', AVG(Score) AS average_score FROM (SELECT CAST((DATEDIFF(m, CreationDate, GETDATE()) / 12) AS VARCHAR) + ' Y' AS Age, Score, PostTypeId FROM Posts WHERE Score >= 101) AS t GROUP BY age, PostTypeId ORDER BY PostTypeId, age
sede
CREATE TABLE engineer_visits ( engineer_visit_id number, contact_staff_id number, engineer_id number, fault_log_entry_id number, fault_status text, visit_start_datetime time, visit_end_datetime time, other_visit_details text ) CREATE TABLE third_party_companies ( company_id number, ...
SELECT T1.asset_id, T1.asset_details FROM assets AS T1 JOIN asset_parts AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING COUNT(*) = 2 INTERSECT SELECT T1.asset_id, T1.asset_details FROM assets AS T1 JOIN fault_log AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING COUNT(*) < 2
spider
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM, AMOUNT FROM t_kc22 WHERE MED_CLINIC_ID = '43577084038' AND AMOUNT > (SELECT MIN(AMOUNT) FROM t_kc22 WHERE MED_CLINIC_ID = '43577084038') ORDER BY AMOUNT DESC
css
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 mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY"
mimicsql_data
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 jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '朱泰和' AND jy...
css
CREATE TABLE table_name_72 ( character_name VARCHAR, release_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the character name for the film with a release date of July 29, 1938?
SELECT character_name FROM table_name_72 WHERE release_date = "july 29, 1938"
sql_create_context
CREATE TABLE table_67130 ( "Year" real, "Event" text, "Venue" text, "Driver" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years did Wilson Fittipaldi race?
SELECT COUNT("Year") FROM table_67130 WHERE "Driver" = 'wilson fittipaldi'
wikisql
CREATE TABLE table_57375 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average attendance against the expos?
SELECT AVG("Attendance") FROM table_57375 WHERE "Opponent" = 'expos'
wikisql
CREATE TABLE table_name_13 ( pl_gp VARCHAR, pick__number VARCHAR, rd__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum number of Pl GP when the pick number is 178 and the road number is bigger than 9?
SELECT COUNT(pl_gp) FROM table_name_13 WHERE pick__number = 178 AND rd__number > 9
sql_create_context
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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, JSB...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.Y...
css
CREATE TABLE table_name_20 ( on_site_atms INTEGER, off_site_atms VARCHAR, total_atms VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mean on-site ATMS that have off-site ATMs of 1567, and the total number of ATMs less than 4772?
SELECT AVG(on_site_atms) FROM table_name_20 WHERE off_site_atms = 1567 AND total_atms < 4772
sql_create_context
CREATE TABLE table_69169 ( "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the rank when the start is 10 and the laps are fewer than 192?
SELECT "Rank" FROM table_69169 WHERE "Start" = '10' AND "Laps" < '192'
wikisql
CREATE TABLE table_name_84 ( attendance VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance of the game that had a loss of Wolf (3-4)?
SELECT attendance FROM table_name_84 WHERE loss = "wolf (3-4)"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT demographic.admittime, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "17772"
mimicsql_data
CREATE TABLE table_name_72 ( record VARCHAR, nationality VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Record of the 2012 Hamilton Games from Bahamas?
SELECT record FROM table_name_72 WHERE nationality = "bahamas" AND games = "2012 hamilton"
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_cod...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
atis
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE CO...
SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION, PROF_OFFICE
nvbench
CREATE TABLE table_34204 ( "Year" text, "Flagship Station" text, "Play-by-play" text, "Color commentator(s)" text, "Studio host" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Play-by-play of sean grande, and a Year of 2004-05 had what studio host?
SELECT "Studio host" FROM table_34204 WHERE "Play-by-play" = 'sean grande' AND "Year" = '2004-05'
wikisql
CREATE TABLE table_27734577_8 ( team VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team has a score of w 110 87 (ot)?
SELECT team FROM table_27734577_8 WHERE score = "W 110–87 (OT)"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, su...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W...
mimic_iii
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 WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.admityear < "2151"
mimicsql_data
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, U...
SELECT p.Id AS "post_link", p.Score AS "Score", p.Tags AS "Tags", LENGTH(p.Title) - LENGTH(REPLACE(p.Title, '$', '')) AS "$ Count" FROM Posts AS p WHERE p.PostTypeId = 1 AND LENGTH(p.Title) - LENGTH(REPLACE(p.Title, '$', '')) >= 1 ORDER BY LENGTH(p.Title) - LENGTH(REPLACE(p.Title, '$', '')) DESC
sede
CREATE TABLE table_24046134_1 ( monarch VARCHAR, crowned VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of monarchs for 23 may 1059 crowned
SELECT COUNT(monarch) FROM table_24046134_1 WHERE crowned = "23 May 1059"
sql_create_context
CREATE TABLE table_54925 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did the Home team score when the Away team scored 8.14 (62)?
SELECT "Home team score" FROM table_54925 WHERE "Away team score" = '8.14 (62)'
wikisql
CREATE TABLE table_33851 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Opponent of Philadelphia eagles had what attendance?
SELECT "Attendance" FROM table_33851 WHERE "Opponent" = 'philadelphia eagles'
wikisql
CREATE TABLE table_name_5 ( result VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result when the opponent was fenerbah e?
SELECT result FROM table_name_5 WHERE opponent = "fenerbahçe"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS" AND prescriptions.drug = "Sodium Chloride 0.9% Flush"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "RDW"
mimicsql_data
CREATE TABLE table_name_76 ( to_par VARCHAR, runner_s__up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When John Senden was the runner-up, what was the To Par?
SELECT to_par FROM table_name_76 WHERE runner_s__up = "john senden"
sql_create_context
CREATE TABLE table_26401898_2 ( week INTEGER, final_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least week for l 26 42
SELECT MIN(week) FROM table_26401898_2 WHERE final_score = "L 26–42"
sql_create_context
CREATE TABLE table_23183195_2 ( percentage VARCHAR, road_record VARCHAR, home_record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage for the team with a road record of 3-4 and a home record of 7-0?
SELECT percentage FROM table_23183195_2 WHERE road_record = "3-4" AND home_record = "7-0"
sql_create_context
CREATE TABLE table_name_13 ( pct VARCHAR, losses VARCHAR, finals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many percentages have losses fewer than 1 with finals appearances of 4?
SELECT COUNT(pct) FROM table_name_13 WHERE losses < 1 AND finals = 4
sql_create_context
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 diagnosis ( diagn...
SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2205') AND NOT patient.unitdischargetime IS NULL O...
eicu
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 mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_29915 ( "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 wa...
SELECT "Team" FROM table_29915 WHERE "Date" = 'March 18'
wikisql
CREATE TABLE table_35752 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When David E. Finley was the incumbent what was the result?
SELECT "Result" FROM table_35752 WHERE "Incumbent" = 'david e. finley'
wikisql
CREATE TABLE table_22034853_1 ( year__ceremony_ VARCHAR, original_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the year for the film 'Vitus'?
SELECT year__ceremony_ FROM table_22034853_1 WHERE original_title = "Vitus"
sql_create_context
CREATE TABLE table_203_272 ( id number, "title" text, "release" text, "consoles" text, "handheld" text, "pc" text, "arcade" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many titles are there total in the nfl blitz series ?
SELECT COUNT("title") FROM table_203_272
squall
CREATE TABLE table_67627 ( "Club" text, "Sport" text, "League" text, "Venue" text, "Championships (Years)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Sport has a League of continental basketball league, and a Venue of avalon middle school?...
SELECT "Sport" FROM table_67627 WHERE "League" = 'continental basketball league' AND "Venue" = 'avalon middle school'
wikisql
CREATE TABLE table_203_425 ( id number, "season" number, "driver" text, "equipment" text, "position" number, "points" number, "races" number, "wins" number, "second" number, "third" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT "points" FROM table_203_425 WHERE "driver" = 'modris stelle' AND "season" = 2001
squall
CREATE TABLE table_34105 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Lost has a Drawn larger than 1, and Games smaller than 7?
SELECT MIN("Lost") FROM table_34105 WHERE "Drawn" > '1' AND "Games" < '7'
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 mzjzjlb.SG, mzjzjlb.TZ 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 = '30567808'
css
CREATE TABLE staff ( staff_id number, staff_first_name text, staff_last_name text, other_staff_details text ) CREATE TABLE problems ( problem_id number, product_id number, closure_authorised_by_staff_id number, reported_by_staff_id number, date_problem_reported time, date_proble...
SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > "1986-11-13" GROUP BY T2.product_id
spider
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 prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "3343"
mimicsql_data
CREATE TABLE table_40259 ( "Season" real, "Date" text, "Venue" text, "City" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 1958, what has the IRFU All-Stars Home Venue?
SELECT "Venue" FROM table_40259 WHERE "Home" = 'irfu all-stars' AND "Season" = '1958'
wikisql
CREATE TABLE table_1139087_2 ( grand_prix VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event was in detroit?
SELECT grand_prix FROM table_1139087_2 WHERE location = "Detroit"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '7826174' AND IN_HOSP_DATE BETWEEN '2006-12-24' AND '2014-02-10' AND CLINIC_TYPE = '住院'
css
CREATE TABLE department ( dept_code VARCHAR ) CREATE TABLE course ( dept_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many courses are offered by the Computer Info. Systems department?
SELECT COUNT(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = "Computer Info. Systems"
sql_create_context