instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number...
SELECT Questions, Accepted, Answered, CAST(Questions - Answered AS INT) AS Unanswered, CAST(CAST(Accepted / Questions * 100 AS FLOAT(5, 1)) AS TEXT(5)) + '%' AS PercentAccepted, CAST(CAST(Answered / Questions * 100 AS FLOAT(5, 1)) AS TEXT(5)) + '%' AS PercentAnswered FROM (SELECT COUNT(*) * 1.0 AS Questions, SUM(CASE W...
sede
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
(SELECT jybgb.SHSJ 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 = '53577732' AND jybgb.BGRQ BETWEEN '2003-09-03' AND '2003-10-12') UNI...
css
CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the ra...
SELECT Class, COUNT(*) FROM race GROUP BY Class
nvbench
CREATE TABLE table_64461 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game at the Chicago Stadium?
SELECT "Score" FROM table_64461 WHERE "Location/Attendance" = 'chicago stadium'
wikisql
CREATE TABLE table_name_37 ( player VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the player with a score of 70-69=139?
SELECT player FROM table_name_37 WHERE score = 70 - 69 = 139
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '006-185446' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-6 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
CREATE TABLE table_name_79 ( hometown_school VARCHAR, team VARCHAR, pick VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Hometown/School had a pick above 30, position of OF and team of Cleveland Indians?
SELECT hometown_school FROM table_name_79 WHERE pick > 30 AND position = "of" AND team = "cleveland indians"
sql_create_context
CREATE TABLE table_test_23 ( "id" int, "previous_mi" bool, "anemia" bool, "left_ventricular_ejection_fraction_lvef" int, "tolerate_gadolinium_contrast_media" bool, "renal_disease" bool, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "tolerate_magnet...
SELECT * FROM table_test_23 WHERE liver_disease = 1 OR kidney_disease = 1
criteria2sql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT * FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '56729345369' AND t_kc22.MED_ORG_DEPT_NM LIKE '%神内%'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "27" AND procedures.icd9_code = "5012"
mimicsql_data
CREATE TABLE table_52015 ( "D 40 \u221a" text, "D 41 \u221a" text, "D 42 \u221a" text, "D 43 \u221a" text, "D 44 \u221a" text, "D 45 O" text, "D 46 O" text, "R 53 +" text, "R 52 +" text, "R 51 +" text ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT "D 45 O" FROM table_52015 WHERE "R 51 +" = 'd 30'
wikisql
CREATE TABLE table_65692 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the IHSAA Football class at Culver?...
SELECT "IHSAA Football Class" FROM table_65692 WHERE "Location" = 'culver'
wikisql
CREATE TABLE table_203_345 ( id number, "name" text, "party" text, "took office" number, "left office" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the only liberal candidate to take office ?
SELECT "name" FROM table_203_345 WHERE "party" = 'liberal'
squall
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT * FROM PostHistoryTypes AS PHT JOIN PostHistory AS PH ON PHT.Id = PH.PostHistoryTypeId WHERE PostId = 13552
sede
CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Age int ) CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time bool ) CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type...
SELECT Home_city, COUNT(Home_city) FROM driver GROUP BY Home_city ORDER BY COUNT(Home_city) DESC
nvbench
CREATE TABLE table_46246 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Record of the Chicago Black Hawks Home game with the New York Rangers and a Score of 3 2?
SELECT "Record" FROM table_46246 WHERE "Home" = 'chicago black hawks' AND "Visitor" = 'new york rangers' AND "Score" = '3–2'
wikisql
CREATE TABLE table_21021796_1 ( valves INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the greatest number of valves?
SELECT MIN(valves) FROM table_21021796_1
sql_create_context
CREATE TABLE table_7269 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Country Scored 66-69=135?
SELECT "Country" FROM table_7269 WHERE "Score" = '66-69=135'
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 t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM, AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6177251' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY AVG(t_kc21.IN_HOSP_DAYS)
css
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'coronary artery disease - known' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(C...
eicu
CREATE TABLE table_name_1 ( points VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Focus that has a Year bigger than 1977?
SELECT points FROM table_name_1 WHERE year > 1977
sql_create_context
CREATE TABLE table_77092 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round did the celtic played away on 24 february 1900?
SELECT "Round" FROM table_77092 WHERE "Opponent" = 'celtic' AND "Date" = '24 february 1900'
wikisql
CREATE TABLE table_19624 ( "Explosion" text, "Location" text, "Date" text, "Yield (approximate)" text, "Altitude (km)" text, "Nation of Origin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What explosion had an altitude of 539 km?
SELECT "Explosion" FROM table_19624 WHERE "Altitude (km)" = '539'
wikisql
CREATE TABLE table_14724369_1 ( no_in_series VARCHAR, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which series numbers were directed by Monte Young?
SELECT no_in_series FROM table_14724369_1 WHERE directed_by = "Monte Young"
sql_create_context
CREATE TABLE table_34853 ( "sSpec number" text, "Frequency" text, "L2 cache" text, "Mult." text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" text, "Release price ( USD )" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Mult." FROM table_34853 WHERE "sSpec number" = 'slj6d(b1)slj6f(b1)'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Neutral, ACC_Percent FROM basketball_match
nvbench
CREATE TABLE table_26034 ( "Pos" real, "No." real, "Driver" text, "Team" text, "Chassis/Engine" text, "Laps" real, "Time/Retired" text, "Grid" real, "Laps Led" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which t...
SELECT "Team" FROM table_26034 WHERE "Chassis/Engine" = 'Lola T92/00/ Buick'
wikisql
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEG...
SELECT date, COUNT(date) FROM weather WHERE zip_code = 94107 AND events <> "Fog" AND events <> "Rain" ORDER BY COUNT(date)
nvbench
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '07290816' AND jyjgzbb.JCZBJGDL < jyjgzbb.CKZFWXX OR jyjgzbb...
css
CREATE TABLE table_name_59 ( attendance VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Attendance of the game with a Score of 3 2?
SELECT COUNT(attendance) FROM table_name_59 WHERE score = "3–2"
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 hz_info ( KH text, KLX number...
SELECT jybgb.JYLX FROM jybgb WHERE jybgb.BGDH = '63570013997'
css
CREATE TABLE table_name_52 ( opponent VARCHAR, record VARCHAR, october VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent before October 31 with a Record of 2-3-1 after Game 5?
SELECT opponent FROM table_name_52 WHERE october < 31 AND game > 5 AND record = "2-3-1"
sql_create_context
CREATE TABLE table_64559 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent for game 73?
SELECT "Opponent" FROM table_64559 WHERE "Game" = '73'
wikisql
CREATE TABLE table_40858 ( "Season" text, "Round" text, "Country" text, "Opponent" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the second round?
SELECT "Result" FROM table_40858 WHERE "Round" = 'second round'
wikisql
CREATE TABLE table_name_29 ( heavy_attacks VARCHAR, luftflotte_2_sorties VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many heavy attacks did the 450 Luftflotte 2 conduct?
SELECT COUNT(heavy_attacks) FROM table_name_29 WHERE luftflotte_2_sorties = 450
sql_create_context
CREATE TABLE table_name_65 ( visitor VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the visiting team on November 26, 2007?
SELECT visitor FROM table_name_65 WHERE date = "november 26, 2007"
sql_create_context
CREATE TABLE table_204_95 ( id number, "name" text, "title" text, "first year\nin this position" number, "years at nebraska" text, "alma mater" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many consecutive years did biff jones coach ?
SELECT "years at nebraska" - "years at nebraska" FROM table_204_95 WHERE "name" = 'biff jones'
squall
CREATE TABLE table_54088 ( "House Name" text, "Composition" text, "Named after" text, "Founded" real, "Colours" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What colours have a House Name of ogun?
SELECT "Colours" FROM table_54088 WHERE "House Name" = 'ogun'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number,...
SELECT TagName, ts.SourceTagName, Count FROM Tags AS t LEFT JOIN TagSynonyms AS ts ON t.TagName = ts.TargetTagName WHERE (TagName LIKE '%azure%') ORDER BY Count DESC
sede
CREATE TABLE table_24395 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the successor for the new seat?
SELECT "Successor" FROM table_24395 WHERE "Vacator" = 'New seat'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE" AND procedures.long_title = "Open and other replacement of aortic valve with tissue graft"
mimicsql_data
CREATE TABLE table_51150 ( "Tribunal" text, "Number of autos da f\u00e9 with known sentences" text, "Executions in persona" text, "Executions in effigie" text, "Penanced" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many were...
SELECT "Penanced" FROM table_51150 WHERE "Total" = '7666'
wikisql
CREATE TABLE table_name_15 ( player VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the player that is from seattle prep?
SELECT player FROM table_name_15 WHERE school = "seattle prep"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'oxygen therapy (> 60%) - 70-80%' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-4 yea...
eicu
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Abdomen artery incision"
mimicsql_data
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, Pos...
SELECT p.Id, COUNT(*) AS DelVote, p.Score AS Score, p.Id AS "post_link", CASE WHEN p.PostTypeId = 1 THEN 'Q' WHEN p.PostTypeId = 2 THEN 'A' ELSE '?' END AS Type, p.DeletionDate FROM Posts AS p JOIN Votes AS V ON v.PostId = p.Id WHERE VoteTypeId = 11 AND NOT p.DeletionDate IS NULL GROUP BY p.Id, p.PostTypeId, p.Score, p...
sede
CREATE TABLE table_53264 ( "NATO member" text, "Aircraft carriers" text, "Battleships" text, "Cruisers" text, "Escorts" text, "Submarines" text, "Torpedo boat squadrons" text, "s Motor ship / s Naval trawler" text, "Grand Total" real ) -- Using valid SQLite, answer the following qu...
SELECT "Escorts" FROM table_53264 WHERE "Cruisers" = '6'
wikisql
CREATE TABLE table_203_34 ( id number, "season" text, "appearance" number, "interchange" number, "tries" number, "goals" number, "f/g" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average of all 14 interc...
SELECT AVG("interchange") FROM table_203_34
squall
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 chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21163) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid...
mimic_iii
CREATE TABLE table_name_43 ( country VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country was rank 4?
SELECT country FROM table_name_43 WHERE rank = "4"
sql_create_context
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, ...
SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY dorm_name DESC
nvbench
CREATE TABLE table_18893428_1 ( driver VARCHAR, constructor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of drivers who have cars constructed by Mercedes-Benz?
SELECT COUNT(driver) FROM table_18893428_1 WHERE constructor = "Mercedes-Benz"
sql_create_context
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '前列腺增生' AND hz_info.RYBH ...
css
CREATE TABLE table_20056 ( "Position" real, "Team" text, "Points" real, "Played" real, "Won" real, "Drawn" real, "Lost" real, "For" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lease ...
SELECT MIN("For") FROM table_20056 WHERE "Points" = '19'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number,...
SELECT p.Id, p.Title, p.Tags, p.CreationDate FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 AND p.CreationDate >= '2010-01-01 23:59:00.000' AND t.TagName IN ('android-testing')
sede
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 demographic.gender, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_51918 ( "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. -- Which away team has a Home team score of 17.13 (...
SELECT "Away team" FROM table_51918 WHERE "Home team score" = '17.13 (115)'
wikisql
CREATE TABLE table_203_655 ( id number, "goal" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the most goals scored in one game ?
SELECT MAX("score" + "score") FROM table_203_655
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "NADO20" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_name_69 ( country VARCHAR, transfer_window VARCHAR, moving_from VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the country of the player moving from belgrano with a summer transfer window?
SELECT country FROM table_name_69 WHERE transfer_window = "summer" AND moving_from = "belgrano"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7764485' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 27
css
CREATE TABLE table_75393 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a March larger than 15, and Points larger than 96, and a Game smaller tha...
SELECT "Score" FROM table_75393 WHERE "March" > '15' AND "Points" > '96' AND "Game" < '76' AND "Opponent" = '@ washington capitals'
wikisql
CREATE TABLE table_name_22 ( year INTEGER, score_final VARCHAR, rank_final VARCHAR, competition_description VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years have a Rank-Final smaller than 7, and a Competition Description of olympic games...
SELECT SUM(year) FROM table_name_22 WHERE rank_final < 7 AND competition_description = "olympic games" AND score_final < 186.525
sql_create_context
CREATE TABLE body_builder ( Snatch INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average snatch score of body builders?
SELECT AVG(Snatch) FROM body_builder
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE 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.diagnosis = "CHEST PAIN" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_33238 ( "Region" text, "Host" text, "Venue" text, "City" text, "State" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city in the mideast region is the hot of Temple University?
SELECT "City" FROM table_33238 WHERE "Region" = 'mideast' AND "Host" = 'temple university'
wikisql
CREATE TABLE table_69074 ( "Episode No." real, "Airdate" text, "Total Viewers" real, "Share" text, "BBC One Weekly Ranking" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the air-dates of the episodes before episode 4 that had a BBC One we...
SELECT "Airdate" FROM table_69074 WHERE "Episode No." < '4' AND "BBC One Weekly Ranking" = '6'
wikisql
CREATE TABLE store ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many stores are there?
SELECT COUNT(*) FROM store
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Descr...
SELECT UserId AS "user_link", COUNT(Id) AS "comments" FROM Comments WHERE LOWER(Text) LIKE LOWER('%##word##%') GROUP BY UserId ORDER BY COUNT(Id) DESC
sede
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length in...
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci...
atis
CREATE TABLE table_28178756_1 ( miles__km_ VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the numer of miles for 2010.
SELECT miles__km_ FROM table_28178756_1 WHERE year = 2010
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.days_stay, demographic.admission_location FROM demographic WHERE demographic.name = "Mary Davis"
mimicsql_data
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '何晓兰' AND t_kc22.STA_DATE BETWEEN '2004-09-27' AND '2017-08-12' AND t_kc22.SOC_SRT_DIRE_NM = '硝苯地平控释片'
css
CREATE TABLE table_name_93 ( position VARCHAR, wins VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was his position in 2009 with 1 win?
SELECT position FROM table_name_93 WHERE wins = "1" AND season = "2009"
sql_create_context
CREATE TABLE table_76182 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place has E as the to par, with Mark Wiebe as the player?
SELECT "Place" FROM table_76182 WHERE "To par" = 'e' AND "Player" = 'mark wiebe'
wikisql
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 gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '花华彩' UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '花华彩'
css
CREATE TABLE table_name_75 ( laps INTEGER, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average laps driven by david coulthard?
SELECT AVG(laps) FROM table_name_75 WHERE driver = "david coulthard"
sql_create_context
CREATE TABLE table_name_66 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the home team when hawthorn is the away side?
SELECT home_team FROM table_name_66 WHERE away_team = "hawthorn"
sql_create_context
CREATE TABLE table_name_47 ( winner VARCHAR, win__number INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had more than 3 wins?
SELECT winner FROM table_name_47 WHERE win__number > 3
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 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '80476579' AND t_kc22.STA_DATE BETWEEN '2001-01-31' AND '2009-08-12' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸多奈哌齐片(薄膜)'
css
CREATE TABLE table_56815 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent on May 7?
SELECT "Opponent" FROM table_56815 WHERE "Date" = 'may 7'
wikisql
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 MIN(demographic.age) FROM demographic WHERE demographic.age >= "83" AND demographic.days_stay = "43"
mimicsql_data
CREATE TABLE table_name_34 ( time VARCHAR, rider VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time has phil mcgurk as the rider?
SELECT time FROM table_name_34 WHERE rider = "phil mcgurk"
sql_create_context
CREATE TABLE table_name_87 ( team VARCHAR, time_retired VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Team which has a Time/Retired of contact, and a Grid smaller than 17?
SELECT team FROM table_name_87 WHERE time_retired = "contact" AND grid < 17
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 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 COMMISSION_PCT, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmoun...
SELECT Id AS "post_link", CreationDate, Score, Tags FROM Posts WHERE Tags IN ('<' + '##tag1:string##' + '><' + '##tag2:string##' + '>', '<' + '##tag2:string##' + '><' + '##tag1:string##' + '>') AND AnswerCount = 0 ORDER BY CreationDate DESC
sede
CREATE TABLE table_62660 ( "Rank" real, "Railway Station" text, "Annual entry/exit (millions) 2011\u201312" real, "Annual interchanges (millions) 2011\u201312" real, "Total Passengers (millions) 2011\u201312" real, "Location" text, "Number of Platforms" real ) -- Using valid SQLite, answer...
SELECT "Rank" FROM table_62660 WHERE "Annual interchanges (millions) 2011\u201312" < '1.99' AND "Annual entry/exit (millions) 2011\u201312" < '13.835' AND "Total Passengers (millions) 2011\u201312" > '13.772'
wikisql
CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) -- Using valid SQLite, answer...
SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY Team DESC
nvbench
CREATE TABLE table_name_29 ( score VARCHAR, golden_point_s__scorer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score of Golden Point(s) scorer Adam Reynolds?
SELECT score FROM table_name_29 WHERE golden_point_s__scorer = "adam reynolds"
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.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '48885255' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 7137.7)
css
CREATE TABLE table_28628309_6 ( average VARCHAR, totals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many items appear in the average column when the totals were 105-161?
SELECT COUNT(average) FROM table_28628309_6 WHERE totals = "105-161"
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1"
mimicsql_data
CREATE TABLE table_name_35 ( finish VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which finish has a Record of 74-68?
SELECT finish FROM table_name_35 WHERE record = "74-68"
sql_create_context
CREATE TABLE table_204_854 ( id number, "#" number, "wrestlers" text, "reign" number, "date" text, "days\nheld" number, "location" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what location hosted more , osaka or tokyo ?
SELECT "location" FROM table_204_854 WHERE "location" IN ('osaka', 'tokyo') GROUP BY "location" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-9128')) AND microlab.culturesite = 'sputum, tracheal specimen...
eicu
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Student ( S...
SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY AVG(T1.Age) DESC
nvbench
CREATE TABLE table_39116 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of drawn games when there are fewer than 4 points and more than 4 lost ...
SELECT MIN("Drawn") FROM table_39116 WHERE "Points" < '4' AND "Lost" > '4'
wikisql
CREATE TABLE table_11094 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date the new york giants were the visiting team and the Final Score was 37-34?
SELECT "Date" FROM table_11094 WHERE "Visiting Team" = 'new york giants' AND "Final Score" = '37-34'
wikisql
CREATE TABLE journal_committee ( Editor_ID VARCHAR ) CREATE TABLE editor ( Name VARCHAR, Editor_ID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the names of editors that are on at least two journal committees.
SELECT T1.Name FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Name HAVING COUNT(*) >= 2
sql_create_context