instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_44603 ( "Number" text, "Builder" text, "Type" text, "Date" text, "Works number" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Builder H. K. Porter, inc who had a type of 0-4-4 Forney locomotive, has what works number?
SELECT "Works number" FROM table_44603 WHERE "Type" = '0-4-4 forney locomotive' AND "Builder" = 'h. k. porter, inc'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.days_stay = "17"
mimicsql_data
CREATE TABLE table_22597626_6 ( surface VARCHAR, score_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the surface for 6 0, 6 3
SELECT surface FROM table_22597626_6 WHERE score_in_the_final = "6–0, 6–3"
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Cr...
SELECT Users.Id, Users.Id AS "user_link", COUNT(Posts.Id) AS NumPosts, SUM(Posts.Score) AS SumScore, AVG(CAST(Posts.Score AS FLOAT)) AS AvgScore, STDEV(Posts.Score) AS StdDevScore, AVG(CAST(Posts.Score AS FLOAT)) - STDEV(Posts.Score) AS XXX FROM Posts INNER JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Posts.PostTyp...
sede
CREATE TABLE cite ( cited int, citing int ) CREATE TABLE author ( aid int, homepage varchar, name varchar, oid int ) CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE publication_keyword ( kid int, pid int ) CREATE TABLE publication ( ab...
SELECT title FROM publication WHERE citation_num > 200
academic
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '吴兰若' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2008-07-26')
css
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 zyjzjlb WHERE JZKSDM = '87709' AND RYDJSJ BETWEEN '2006-12-25' AND '2007-07-04'
css
CREATE TABLE table_name_11 ( score VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did st. louis score at home?
SELECT score FROM table_name_11 WHERE home = "st. louis"
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2164" AND diagnoses.icd9_code = "3315"
mimicsql_data
CREATE TABLE table_name_51 ( played INTEGER, goals_against VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Played has Goals against smaller than 34, and Wins smaller than 13?
SELECT SUM(played) FROM table_name_51 WHERE goals_against < 34 AND wins < 13
sql_create_context
CREATE TABLE table_40895 ( "Rank" real, "Name" text, "Years" text, "Matches" text, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Matches that has the Rank of 1?
SELECT "Matches" FROM table_40895 WHERE "Rank" = '1'
wikisql
CREATE TABLE table_76861 ( "Game" real, "Date" text, "Team" text, "Score" text, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Game had a Score of 101 92?
SELECT AVG("Game") FROM table_76861 WHERE "Score" = '101–92'
wikisql
CREATE TABLE table_name_57 ( label VARCHAR, region VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the label in the region of Canada?
SELECT label FROM table_name_57 WHERE region = "canada"
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_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '48319787' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3818.79)
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.age >= "24" AND demographic.admityear >= "2176"
mimicsql_data
CREATE TABLE table_name_91 ( goals INTEGER, name VARCHAR, matches VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average goals for Jimmy Greaves, and matches more than 516?
SELECT AVG(goals) FROM table_name_91 WHERE name = "jimmy greaves" AND matches > 516
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "KCL40I"
mimicsql_data
CREATE TABLE table_74898 ( "Round" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a Date of 22 July, what is the Winning team?
SELECT "Winning team" FROM table_74898 WHERE "Date" = '22 july'
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 jybgb.BGDH 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 = '13405731' AND jybgb.BGRQ BETWEEN '2019-02-09' AND '2020-11-19' UNION...
css
CREATE TABLE table_name_18 ( city VARCHAR, prize VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is City, when Prize is '$146,000'?
SELECT city FROM table_name_18 WHERE prize = "$146,000"
sql_create_context
CREATE TABLE table_72926 ( "Body style" text, "Wheelbase" text, "Length" text, "Height" text, "Curb weight" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the length of the model with Sedan body style?
SELECT "Length" FROM table_72926 WHERE "Body style" = 'Sedan'
wikisql
CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) CREATE TABLE takes ( ...
SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name ORDER BY dept_name DESC
nvbench
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLO...
SELECT COUNTRY_NAME, COUNT(COUNTRY_NAME) FROM countries GROUP BY COUNTRY_NAME
nvbench
CREATE TABLE table_dev_21 ( "id" int, "gender" string, "leukopenia" int, "dialysis" bool, "hemoglobin_a1c_hba1c" float, "cd4_count" int, "platelets" int, "renal_disease" bool, "fasting_triglycerides" int, "hyperlipidemia" bool, "lymphopenia" int, "hba1c" float, "fasti...
SELECT * FROM table_dev_21 WHERE (baseline_hemoglobin_hgb < 11.7 AND gender = 'female') OR (baseline_hemoglobin_hgb < 13 AND gender = 'male') OR lymphopenia < 1000 OR leukopenia < 3000 OR cd4_count < 500 OR platelets < 150000
criteria2sql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ...
SELECT DATEADD(day, DATEDIFF(day, 0, Date), 0) AS Date, Class, COUNT(*) FROM Badges WHERE UserId = '##UserId:int##' GROUP BY DATEADD(day, DATEDIFF(day, 0, Date), 0), Class
sede
CREATE TABLE table_name_91 ( nba_draft VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which NBA draft has a School of st. mary's high school?
SELECT nba_draft FROM table_name_91 WHERE school = "st. mary's high school"
sql_create_context
CREATE TABLE table_16661199_2 ( giants_points VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of giants points for opponents being 31
SELECT COUNT(giants_points) FROM table_16661199_2 WHERE opponents = 31
sql_create_context
CREATE TABLE table_1640 ( "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. -- Name the team for mario somma
SELECT "Team" FROM table_1640 WHERE "Replaced by" = 'Mario Somma'
wikisql
CREATE TABLE table_2508633_4 ( pick__number VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What number pick was Danny Walters in the 1983 NFL draft?
SELECT COUNT(pick__number) FROM table_2508633_4 WHERE player = "Danny Walters"
sql_create_context
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType ORDER BY AllergyType DESC
nvbench
CREATE TABLE table_18018248_2 ( club VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many clubs had 29 points?
SELECT COUNT(club) FROM table_18018248_2 WHERE points = 29
sql_create_context
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 zyjzjlb ( YLJGDM text, JZLSH ...
(SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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.B...
css
CREATE TABLE table_name_82 ( try_bp VARCHAR, losing_bp VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the try BP when the losing BP is 4 and the club is Bargoed RFC?
SELECT try_bp FROM table_name_82 WHERE losing_bp = "4" AND club = "bargoed rfc"
sql_create_context
CREATE TABLE table_14747043_1 ( class_aA VARCHAR, class_a VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which is the class AA when graford was the class A
SELECT class_aA FROM table_14747043_1 WHERE class_a = "Graford"
sql_create_context
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 bdmzjzjlb ( CYBQDM text, CYBQ...
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 date_day ( month_number int, day_number int, year int, 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, ...
SELECT DISTINCT airline.airline_code FROM airline, 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n...
atis
CREATE TABLE table_39303 ( "Nationality" text, "Matches" real, "Drawn" real, "Lost" real, "Win %" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Nationality of england, and a Lost larger than 39, and a Win % of 28.7, and a Drawn smaller than 37 had ...
SELECT SUM("Matches") FROM table_39303 WHERE "Nationality" = 'england' AND "Lost" > '39' AND "Win %" = '28.7' AND "Drawn" < '37'
wikisql
CREATE TABLE table_name_62 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date was the Record 9 6 4?
SELECT date FROM table_name_62 WHERE record = "9–6–4"
sql_create_context
CREATE TABLE table_name_5 ( date VARCHAR, visitor VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When has a Visitor of new england whalers, and a Record of 9 9 1? Question 2
SELECT date FROM table_name_5 WHERE visitor = "new england whalers" AND record = "9–9–1"
sql_create_context
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_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.PERSON_ID = '78591362' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED...
css
CREATE TABLE table_57625 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome of the game that had a score of 3 6, 6 3, 6 0?
SELECT "Outcome" FROM table_57625 WHERE "Score" = '3–6, 6–3, 6–0'
wikisql
CREATE TABLE table_14966667_19 ( class VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what class is Braxton Kelley in?
SELECT COUNT(class) FROM table_14966667_19 WHERE name = "Braxton Kelley"
sql_create_context
CREATE TABLE table_203_125 ( id number, "club" text, "winners" number, "runner-ups" number, "winning years" text, "runner-up years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- vfb admira wacker modling has the same number of wins as what othe...
SELECT "club" FROM table_203_125 WHERE "club" <> 'vfb admira wacker modling' AND "winners" = (SELECT "winners" FROM table_203_125 WHERE "club" = 'vfb admira wacker modling')
squall
CREATE TABLE table_71349 ( "Rank" real, "Round" text, "Home team" text, "Away team" text, "Result" text, "Location" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the game when the away team was dy...
SELECT "Attendance" FROM table_71349 WHERE "Away team" = 'dynamo kyiv' AND "Home team" = 'torpedo zaporizhia'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 82132) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-12 month') ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time...
SELECT COUNT(*) FROM (SELECT (d.Id) AS id FROM Posts AS d LEFT JOIN PostHistory AS ph ON ph.PostId = d.Id LEFT JOIN PostLinks AS pl ON pl.PostId = d.Id LEFT JOIN Posts AS o ON o.Id = pl.RelatedPostId LEFT JOIN Users AS u ON u.Id = d.OwnerUserId WHERE d.PostTypeId = 1 AND pl.LinkTypeId = 3 AND ph.PostHistoryTypeId = 10 ...
sede
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 WHERE demographic.discharge_location = "HOME" AND diagnoses.long_title = "Anxiety state, unspecified"
mimicsql_data
CREATE TABLE table_11317 ( "Missile" text, "Project" text, "Type" text, "Warhead" text, "Payload (kg)" text, "Range (km)" text, "Dimension (m)" text, "Fuel/Stages" text, "Weight (kg)" text, "In service" text ) -- Using valid SQLite, answer the following questions for the tables...
SELECT "Type" FROM table_11317 WHERE "Project" = 'igmdp' AND "Weight (kg)" = '16,000'
wikisql
CREATE TABLE table_name_5 ( present_conference VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which conference does the school from Gainesville, Florida, play in?
SELECT present_conference FROM table_name_5 WHERE location = "gainesville, florida"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Septic shock"
mimicsql_data
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "GASTROINTESTINAL BLEED" AND procedures.icd9_code = "14"
mimicsql_data
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType
nvbench
CREATE TABLE gyb ( 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 SUM(t_kc24.PER_ACC_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '华萍雅' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2016-05-05' AND '2021-10-18' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '华萍雅' A...
css
CREATE TABLE table_45420 ( "Game" text, "Date" text, "Home team" text, "Result" text, "Road team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the road team on May 2?
SELECT "Road team" FROM table_45420 WHERE "Date" = 'may 2'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
WITH opened AS (SELECT PostId, COUNT(*) AS num FROM Votes WHERE VoteTypeId = 8 GROUP BY PostId), closed1 AS (SELECT PostId, COUNT(*) AS num FROM Votes WHERE VoteTypeId = 8 GROUP BY PostId), closed2 AS (SELECT ParentId AS PostId, COUNT(*) AS num FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId WHERE VoteTypeId =...
sede
CREATE TABLE table_name_31 ( date VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the total 56 75?
SELECT date FROM table_name_31 WHERE total = "56–75"
sql_create_context
CREATE TABLE table_train_140 ( "id" int, "gender" string, "mini_mental_state_examination_mmse" int, "allergy_to_quinidine" bool, "systolic_blood_pressure_sbp" int, "postural_syncope" bool, "hypotension" bool, "unexplained_syncope" bool, "allergy_to_dextromethorphan" bool, "allerg...
SELECT * FROM table_train_140 WHERE allergy_to_drug = 1
criteria2sql
CREATE TABLE table_name_58 ( round INTEGER, pick__number INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round that had a pick lower than 8?
SELECT MAX(round) FROM table_name_58 WHERE pick__number < 8
sql_create_context
CREATE TABLE table_41325 ( "Season" text, "Division" text, "Finish" text, "Wins" text, "Losses" text, "Pct." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Finish of 28 Wins?
SELECT "Finish" FROM table_41325 WHERE "Wins" = '28'
wikisql
CREATE TABLE table_65999 ( "Rank" real, "Lane" real, "Athlete" text, "Nationality" text, "Time" real, "React" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average lane for Kenya with react larger than 0.212?
SELECT AVG("Lane") FROM table_65999 WHERE "Nationality" = 'kenya' AND "React" > '0.212'
wikisql
CREATE TABLE table_79686 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the call sign with a 222 erp w?
SELECT "Call sign" FROM table_79686 WHERE "ERP W" = '222'
wikisql
CREATE TABLE table_28603 ( "Year" real, "Under-11" text, "Under-13" text, "Under-15" text, "Under-17" text, "Under-19" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years are there where the the under-15 is Arturo Salazar Martinez and ...
SELECT COUNT("Year") FROM table_28603 WHERE "Under-15" = 'Arturo Salazar Martinez' AND "Under-19" = 'Moises Galvez'
wikisql
CREATE TABLE table_37680 ( "Category" text, "Type" text, "Attribute" text, "Bubbles" text, "Cancelable" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Event has Bubbles of yes, Cancelable of yes, Category of mouse, and a Type of contextmenu wha...
SELECT "Attribute" FROM table_37680 WHERE "Bubbles" = 'yes' AND "Cancelable" = 'yes' AND "Category" = 'mouse' AND "Type" = 'contextmenu'
wikisql
CREATE TABLE table_33373 ( "Year" real, "Network" text, "Play-by-play" text, "Color commentator(s)" text, "Sideline reporter(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which sideline reporters worked alongside Frank Gifford and Dan Dierdorf?...
SELECT "Sideline reporter(s)" FROM table_33373 WHERE "Color commentator(s)" = 'frank gifford and dan dierdorf'
wikisql
CREATE TABLE table_name_46 ( i_o_bus VARCHAR, socket VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is I/O bus when socket is socket g1bga-1288?
SELECT i_o_bus FROM table_name_46 WHERE socket = "socket g1bga-1288"
sql_create_context
CREATE TABLE table_48466 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final score for th...
SELECT "Score" FROM table_48466 WHERE "Team" = '@ milwaukee'
wikisql
CREATE TABLE Customers ( customer_id INTEGER, customer_type_code VARCHAR(20), address_line_1 VARCHAR(80), address_line_2 VARCHAR(80), town_city VARCHAR(80), state VARCHAR(80), email_address VARCHAR(255), phone_number VARCHAR(80) ) CREATE TABLE Staff ( staff_id INTEGER, gender VA...
SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_37137 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record after the bout with Alexis Vila...
SELECT "Record" FROM table_37137 WHERE "Opponent" = 'alexis vila'
wikisql
CREATE TABLE table_513 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Total viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the season number for...
SELECT "Season #" FROM table_513 WHERE "Directed by" = 'Patrick Norris'
wikisql
CREATE TABLE table_1342198_18 ( candidates VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the candidate where district is louisiana 3?
SELECT candidates FROM table_1342198_18 WHERE district = "Louisiana 3"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT demographic.days_stay, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Darlene Martin"
mimicsql_data
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 67468 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY labevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labi...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'simethicone' AND DATETIME(prescriptions.startdate, 'start of year...
mimic_iii
CREATE TABLE table_55328 ( "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyre" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Chassis does Reg Parnell drive?
SELECT "Chassis" FROM table_55328 WHERE "Driver" = 'reg parnell'
wikisql
CREATE TABLE table_59740 ( "Year" text, "Winner" text, "Runner-up" text, "Venue" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the venue in 2002?
SELECT "Venue" FROM table_59740 WHERE "Year" = '2002'
wikisql
CREATE TABLE staff ( staff_id number, gender text, first_name text, last_name text, email_address text, phone_number text ) CREATE TABLE complaints ( complaint_id number, product_id number, customer_id number, complaint_outcome_code text, complaint_status_code text, comp...
SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id JOIN products AS t3 ON t2.product_id = t3.product_id ORDER BY t3.product_price LIMIT 1
spider
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 20898 ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_24615 ( "Original number" text, "UIC number" text, "Name" text, "Constructer" text, "constructor number" real, "Year" real, "Withdrawn" text, "Kilometers worked" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 'vir...
SELECT "Withdrawn" FROM table_24615 WHERE "Name" = 'Virgen de Gracia'
wikisql
CREATE TABLE table_77910 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score when the opponent was the dodgers on april 21
SELECT "Score" FROM table_77910 WHERE "Opponent" = 'dodgers' AND "Date" = 'april 21'
wikisql
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 qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '郎正豪' UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '郎正豪' UNION SELECT zyb.IN_DIAG_DIS_CD, zyb.IN_DIAG_DIS_NM FROM zyb WHERE zyb.PERSON_NM = '郎正豪' UNION SELECT mzb.IN_DIAG_DIS_CD, mzb.IN_DIAG_DIS_NM FROM mz...
css
CREATE TABLE table_name_12 ( game VARCHAR, high_rebounds VARCHAR, high_assists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What numbered game featured a High rebounds of radoslav nesterovi (8), and a High assists of jos calder n (9)?
SELECT COUNT(game) FROM table_name_12 WHERE high_rebounds = "radoslav nesterović (8)" AND high_assists = "josé calderón (9)"
sql_create_context
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 Name, Weight FROM people ORDER BY Weight
nvbench
CREATE TABLE film_actor ( actor_id number, film_id number, last_update time ) CREATE TABLE city ( city_id number, city text, country_id number, last_update time ) CREATE TABLE film ( film_id number, title text, description text, release_year time, language_id number, ...
SELECT COUNT(DISTINCT last_name) FROM actor
spider
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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 nu...
SELECT jybgb.JYLX FROM jybgb WHERE jybgb.BGDH = '48451516947'
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "3897"
mimicsql_data
CREATE TABLE table_58335 ( "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. -- When the School is Bishop Luers High School, what is the Hometown?
SELECT "Hometown" FROM table_58335 WHERE "School" = 'bishop luers high school'
wikisql
CREATE TABLE table_1137 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record for result of l 17 50
SELECT "Record" FROM table_1137 WHERE "Result" = 'L 17–50'
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb...
css
CREATE TABLE table_name_82 ( first_elected VARCHAR, party VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the first elected for the republican party?
SELECT first_elected FROM table_name_82 WHERE party = "republican"
sql_create_context
CREATE TABLE zyb ( 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 COUNT(qtb.MED_SER_ORG_NO) FROM qtb WHERE qtb.PERSON_ID = '95900132' AND qtb.IN_HOSP_DATE BETWEEN '2002-01-04' AND '2014-09-24' UNION SELECT COUNT(gyb.MED_SER_ORG_NO) FROM gyb WHERE gyb.PERSON_ID = '95900132' AND gyb.IN_HOSP_DATE BETWEEN '2002-01-04' AND '2014-09-24' UNION SELECT COUNT(zyb.MED_SER_ORG_NO) FROM zy...
css
CREATE TABLE table_55917 ( "Season" text, "Club" text, "National League" text, "National Cup" text, "European Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What European Cup is in Israeli Premier League?
SELECT "European Cup" FROM table_55917 WHERE "National League" = 'israeli premier league'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY All_Home
nvbench
CREATE TABLE table_21536557_2 ( name VARCHAR, time__cet_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is every name for time(cet) of 09:03?
SELECT name FROM table_21536557_2 WHERE time__cet_ = "09:03"
sql_create_context
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0244651' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-05-16' AND '2016-06-25' AND gwyjzb.IN_DIAG_DIS_CD <> gwyjzb.OUT_DIAG_DIS_CD UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '0244651' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2002-05-16' AND '2016-06-25'...
css
CREATE TABLE table_74120 ( "Program" text, "Exercise" text, "Week" text, "Muscles Worked" text, "Type" text, "Ab Ripper X" text, "Length" text, "Equipment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many types are cardio?
SELECT COUNT("Program") FROM table_74120 WHERE "Type" = 'Cardio'
wikisql
CREATE TABLE table_20064 ( "Class" text, "Wheels" real, "Date" text, "Builder" text, "No. built" real, "1919 nos." text, "LMS Class" text, "LMS nos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the builder of the train with LM...
SELECT "Builder" FROM table_20064 WHERE "LMS Class" = '3F'
wikisql
CREATE TABLE table_name_70 ( place VARCHAR, country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who scored 68-73-66=207 in South Africa?
SELECT place FROM table_name_70 WHERE country = "south africa" AND score = 68 - 73 - 66 = 207
sql_create_context
CREATE TABLE table_18600 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result in Pennsylvania 13?
SELECT "Result" FROM table_18600 WHERE "District" = 'Pennsylvania 13'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
eicu
CREATE TABLE table_66501 ( "Title" text, "Series" text, "Director" text, "Production Num." real, "Release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Release date has a Production Num larger than 5888, and a Director of hugh harman an...
SELECT "Release date" FROM table_66501 WHERE "Production Num." > '5888' AND "Director" = 'hugh harman and friz freleng'
wikisql