instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_69817 ( "Round" text, "Club" text, "Home" text, "Away" text, "Aggregate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which aggregate has ajax as the club?
SELECT "Aggregate" FROM table_69817 WHERE "Club" = 'ajax'
wikisql
CREATE TABLE table_61503 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the wolverhampton wanderers were the opponent, with a crowd larger than 41,415, what was the resul...
SELECT "Result" FROM table_61503 WHERE "Attendance" > '41,415' AND "Opponent" = 'wolverhampton wanderers'
wikisql
CREATE TABLE table_22599 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many ...
SELECT COUNT("Position in table") FROM table_22599 WHERE "Outgoing manager" = 'Keith Downing'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, ...
WITH Raw AS (SELECT PostHistory.Id, PostHistory.Text FROM PostHistory, Posts WHERE PostHistory.PostId = Posts.Id AND Posts.ClosedDate IS NULL AND PostHistory.PostHistoryTypeId = 10), Raw2 AS (SELECT Id, JSON_EXTRACT_SCALAR(Text, '$.Voters0.Id') AS CloserIdStr FROM Raw UNION SELECT Id, JSON_EXTRACT_SCALAR(Text, '$.Voter...
sede
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 wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '57205871' AND hz_info.YLJGDM = '3643376' AND NOT wdmzjzjlb.JZKSMC LIKE '%内分泌%' UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN bdmzjzjlb ON hz_info.Y...
css
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_37201 ( "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total enrollment for an affili...
SELECT COUNT("Enrollment") FROM table_37201 WHERE "Affiliation" = 'public' AND "Founded" < '1866'
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.diagnosis = "GUILLAIN BARRE SYNDROME" AND demographic.age < "31"
mimicsql_data
CREATE TABLE table_54901 ( "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. -- Name the home team in a game where the away team...
SELECT "Home team score" FROM table_54901 WHERE "Away team score" = '14.12 (96)'
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_kc22.MED_EXP_DET_ID 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 = '58780593755' AND t_kc22.REMOTE_SETTLE_FLG = '异地1' OR t_kc22.REMOTE_SETTLE_FLG = '异地2'
css
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.gender = "M" AND demographic.admission_type = "EMERGENCY"
mimicsql_data
CREATE TABLE table_name_5 ( outcome VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Outcome, when Score is 1-6, 3-6?
SELECT outcome FROM table_name_5 WHERE score = "1-6, 3-6"
sql_create_context
CREATE TABLE table_11677100_11 ( school VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school is he the catcher for?
SELECT school FROM table_11677100_11 WHERE position = "Catcher"
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 lab ( labid numbe...
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 = '025-44495')) AND microlab.culturesite = 'sputum, expectorated' AN...
eicu
CREATE TABLE table_9981 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the tournament when 2011 is a, 2009 is lq and 2012 is 1r?
SELECT "Tournament" FROM table_9981 WHERE "2011" = 'a' AND "2009" = 'lq' AND "2012" = '1r'
wikisql
CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(50), customer_middle_initial VARCHAR(1), customer_l...
SELECT gender, COUNT(*) FROM Customers GROUP BY gender
nvbench
CREATE TABLE table_18018214_3 ( loses INTEGER, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losses occurred when the club team was ekranas-2 panev ys
SELECT MAX(loses) FROM table_18018214_3 WHERE club = "Ekranas-2 Panevėžys"
sql_create_context
CREATE TABLE table_52215 ( "Year" real, "Theme" text, "Artist" text, "Mintage" text, "Issue Price" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- A mintage of 31,997 has what issue price?
SELECT "Issue Price" FROM table_52215 WHERE "Mintage" = '31,997'
wikisql
CREATE TABLE table_name_45 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Record, when Date is 1996?
SELECT record FROM table_name_45 WHERE date = "1996"
sql_create_context
CREATE TABLE table_203_674 ( id number, "name" text, "mark" text, "system" text, "from" number, "to" number, "successor" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- was the pennsylvania railroad under the prr or the rf &...
SELECT "system" FROM table_203_674 WHERE "name" = 'pennsylvania railroad'
squall
CREATE TABLE table_17289 ( "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_17289 WHERE "Location Attendance" = 'US Airways Center 18,422'
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 = '0936884' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY AVG(t_kc21.IN_HOSP_DAYS)
css
CREATE TABLE table_29531 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (millions)" text, "Original U.S. air date" text, "Prod. code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many million...
SELECT "U.S. viewers (millions)" FROM table_29531 WHERE "Written by" = 'Jack Sanderson'
wikisql
CREATE TABLE table_6470 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Opponent when the Save was || 36,388 ||15-7||?
SELECT "Opponent" FROM table_6470 WHERE "Save" = '|| 36,388 ||15-7||'
wikisql
CREATE TABLE table_name_81 ( avg_g VARCHAR, gain VARCHAR, long VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Avg/G has a Gain smaller than 1571, and a Long smaller than 46?
SELECT COUNT(avg_g) FROM table_name_81 WHERE gain < 1571 AND long < 46
sql_create_context
CREATE TABLE table_23606 ( "Institution" text, "Team Name" text, "Location (Population)" text, "Team Started" real, "Affiliation" text, "Enrollment" real, "Mascot" text, "Divisional Titles" real, "Big 12 Titles" real, "National Titles" real ) -- Using valid SQLite, answer the f...
SELECT MAX("Enrollment") FROM table_23606 WHERE "Team Name" = 'Sooners'
wikisql
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id INNER JOIN course_...
advising
CREATE TABLE engineer_skills ( engineer_id number, skill_id number ) 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_visi...
SELECT T1.company_name FROM third_party_companies AS T1 JOIN maintenance_contracts AS T2 ON T1.company_id = T2.maintenance_contract_company_id ORDER BY T2.contract_start_date LIMIT 1
spider
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE p...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.age < "71"
mimicsql_data
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE T...
WITH IntelTags AS (SELECT Id, TagName, Count FROM Tags WHERE Tags.TagName LIKE 'intel-%' OR Tags.TagName = 'intel'), IntelPostIds AS (SELECT DISTINCT PostTags.PostId FROM PostTags INNER JOIN IntelTags ON IntelTags.Id = PostTags.TagId) SELECT Id AS "post_link", Body, Tags, CreationDate, Score, ViewCount FROM Posts INNER...
sede
CREATE TABLE table_78828 ( "College or Campus Name" text, "Location" text, "District" text, "Affiliation" text, "Weblink" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What District has a Location of villupuram?
SELECT "District" FROM table_78828 WHERE "Location" = 'villupuram'
wikisql
CREATE TABLE table_79355 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for the date of 16 december 1978, with a tie no of 9?
SELECT "Score" FROM table_79355 WHERE "Date" = '16 december 1978' AND "Tie no" = '9'
wikisql
CREATE TABLE table_16482 ( "Trim" text, "Engine" text, "Turbo" text, "Fuel Delivery" text, "Power" text, "Torque" text, "Transmission" text, "Performance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the turbo where trim is 2.0 ...
SELECT "Turbo" FROM table_16482 WHERE "Trim" = '2.0 20v'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT SHRGH, SHRXM FROM jybgb WHERE JZLSH = '04812473443'
css
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT UserId AS "user_link", COUNT(*) AS Badges FROM Badges WHERE Badges.Name = 'Necromancer' OR Badges.Name = 'Revival' GROUP BY UserId ORDER BY Badges DESC LIMIT 100
sede
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, U...
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
sede
CREATE TABLE table_name_52 ( english VARCHAR, four VARCHAR, house VARCHAR, three VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the language, when 'house' is 'balay', when 'three' is 'tatlo', and when 'four' is 'apat'?
SELECT english FROM table_name_52 WHERE house = "balay" AND three = "tatlo" AND four = "apat"
sql_create_context
CREATE TABLE table_204_465 ( id number, "#" number, "temple name" text, "hangul" text, "hanja" text, "period of reign" text, "personal name" text, "relationship" text, "note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- is gye list...
SELECT (SELECT id FROM table_204_465 WHERE "temple name" = 'gye') < (SELECT id FROM table_204_465 WHERE "temple name" = 'biryu')
squall
CREATE TABLE table_28435 ( "Sd" real, "Rk" real, "Player" text, "Points" real, "Points defending" real, "Points won" real, "New points" real, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times is player Stanislas Wawr...
SELECT COUNT("Points defending") FROM table_28435 WHERE "Player" = 'Stanislas Wawrinka'
wikisql
CREATE TABLE table_name_90 ( home__1st_leg_ VARCHAR, aggregate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the first leg home that had a total aggregate of 3-1?
SELECT home__1st_leg_ FROM table_name_90 WHERE aggregate = "3-1"
sql_create_context
CREATE TABLE table_14601528_2 ( class_aAAAA VARCHAR, school_year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the class aaaaa for 2005-06
SELECT class_aAAAA FROM table_14601528_2 WHERE school_year = "2005-06"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.days_stay > "69"
mimicsql_data
CREATE TABLE wdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb...
css
CREATE TABLE table_name_57 ( village VARCHAR, grand_cru VARCHAR, region VARCHAR, wine_style VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Village has a Region of C te De Nuits, Wine Styles of Red Wine, and a Grand Cru of Latrici res-Chambertin...
SELECT village FROM table_name_57 WHERE region = "côte de nuits" AND wine_style = "red wine" AND grand_cru = "latricières-chambertin"
sql_create_context
CREATE TABLE table_name_97 ( location VARCHAR, method VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which location has a method of decision and Nikos Tsoukalas for an opponent?
SELECT location FROM table_name_97 WHERE method = "decision" AND opponent = "nikos tsoukalas"
sql_create_context
CREATE TABLE table_name_55 ( date VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date has uefa euro 2008 qualification as the competition?
SELECT date FROM table_name_55 WHERE competition = "uefa euro 2008 qualification"
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNT...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE table_42815 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Place of the Player with a Score of 73-73-65-73=284?
SELECT "Place" FROM table_42815 WHERE "Score" = '73-73-65-73=284'
wikisql
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 PERSON_ID = '04297841' AND CLINIC_TYPE = '住院' AND MOD(MED_AMOUT, 1) = 0
css
CREATE TABLE table_name_81 ( sales VARCHAR, peak VARCHAR, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many sales took place with a peak of 1 for Boris?
SELECT COUNT(sales) FROM table_name_81 WHERE peak = 1 AND artist = "boris"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostHistory ( Id number, Po...
SELECT Id AS "comment_link", Score, Text FROM Comments WHERE (UPPER(Text) LIKE UPPER('%##CommentText##%') AND UserId = '##UserId##') ORDER BY Score DESC
sede
CREATE TABLE table_name_47 ( date VARCHAR, man_of_the_match VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was Stuart Potts the Man of the Match?
SELECT date FROM table_name_47 WHERE man_of_the_match = "stuart potts"
sql_create_context
CREATE TABLE table_79290 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT MAX("Latitude") FROM table_79290 WHERE "Pop. (2010)" = '24' AND "Water (sqmi)" > '0.319'
wikisql
CREATE TABLE table_name_23 ( attendance INTEGER, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the sum of the attendance for the calgary home team?
SELECT SUM(attendance) FROM table_name_23 WHERE home = "calgary"
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'depression - moderate' AND DATETIME(diag...
eicu
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '2529055' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-09-30' AND '2012-12-13' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 2796.97 UNION SELECT gyb.MED_ORG_DEPT_CD FR...
css
CREATE TABLE table_17323042_8 ( date VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did they play Miami?
SELECT date FROM table_17323042_8 WHERE team = "Miami"
sql_create_context
CREATE TABLE table_47586 ( "Rank" real, "Team" text, "Played" real, "Wins" real, "Losses" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average rank for more than 12 points?
SELECT AVG("Rank") FROM table_47586 WHERE "Points" > '12'
wikisql
CREATE TABLE table_15451 ( "Date" text, "Location" text, "Nature of incident" text, "Circumstances" text, "Casualties" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the casualities for nation of incident of hostile on 2006-06-26
SELECT "Casualties" FROM table_15451 WHERE "Nature of incident" = 'hostile' AND "Date" = '2006-06-26'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.icd9_code = "725"
mimicsql_data
CREATE TABLE table_203_38 ( id number, "#" number, "title" text, "producer(s)" text, "performer(s)" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the last song on the album ?
SELECT "title" FROM table_203_38 ORDER BY "#" DESC LIMIT 1
squall
CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) ...
SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr) DESC
nvbench
CREATE TABLE table_41468 ( "Club" text, "2012" text, "Seasons in Esiliiga" real, "Current run since" real, "Titles" real, "Last title" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2012 season in Esiliiga more than 4, and more than ...
SELECT "2012" FROM table_41468 WHERE "Seasons in Esiliiga" > '4' AND "Titles" > '0'
wikisql
CREATE TABLE table_204_970 ( id number, "year" number, "award" text, "category" text, "title" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long after his first best actor academy award , did mr. borgnine receive his screen a...
SELECT ABS((SELECT "year" FROM table_204_970 WHERE "category" = 'best actor' AND "award" = 'academy award') - (SELECT "year" FROM table_204_970 WHERE "award" = 'screen actors guild life achievement award'))
squall
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.admityear < "2182" AND lab.label = "C4"
mimicsql_data
CREATE TABLE market ( Market_ID int, Country text, Number_cities int ) CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE film ( Film_ID int, Title text, Stud...
SELECT Year, COUNT(Year) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = "Japan" ORDER BY T1.Year 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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_40587 ( "Result" text, "Record" text, "Opponent" text, "Method" text, "Date" text, "Round" real, "Location" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Result, when Date is 2003?
SELECT "Result" FROM table_40587 WHERE "Date" = '2003'
wikisql
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address ...
SELECT apt_number, COUNT(apt_number) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id GROUP BY apt_number ORDER BY COUNT(apt_number)
nvbench
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND lab.itemid = "51044"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN"
mimicsql_data
CREATE TABLE table_13498403_1 ( barrier INTEGER, trainer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How old is Daniel Morton
SELECT MAX(barrier) FROM table_13498403_1 WHERE trainer = "Daniel Morton"
sql_create_context
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 WHERE demographic.admission_type = "EMERGENCY" AND demographic.insurance = "Medicare"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM t...
(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') UNI...
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.admission_type = "URGENT" AND procedures.short_title = "Percu gastrojejunostomy"
mimicsql_data
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 jyjgzbb.JYZBLSH FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B...
css
CREATE TABLE table_10321 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which attendance has the 25 17 5 record?
SELECT "Attendance" FROM table_10321 WHERE "Record" = '25–17–5'
wikisql
CREATE TABLE table_name_18 ( round INTEGER, college VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round for College of Nebraska if the Overall is under 190?
SELECT MAX(round) FROM table_name_18 WHERE college = "nebraska" AND overall < 190
sql_create_context
CREATE TABLE table_11600 ( "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. -- How many people attended games at vfl park?
SELECT SUM("Crowd") FROM table_11600 WHERE "Venue" = 'vfl park'
wikisql
CREATE TABLE table_37414 ( "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 score of the game on November 12 with the Chicago Black Hawks as the visitor team?
SELECT "Score" FROM table_37414 WHERE "Visitor" = 'chicago black hawks' AND "Date" = 'november 12'
wikisql
CREATE TABLE table_23840623_4 ( dirty_electric_grid_rocky_mountains__denver_ VARCHAR, clean_electric_grid_california__san_francisco_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the dirty electric grid rocky mountains (denver) for the vehicle with ...
SELECT dirty_electric_grid_rocky_mountains__denver_ FROM table_23840623_4 WHERE clean_electric_grid_california__san_francisco_ = "160 g/mi (99 g/km)"
sql_create_context
CREATE TABLE table_name_1 ( left_office VARCHAR, inaugurated VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Left Office, when Inaugurate is '15 March 1930'?
SELECT left_office FROM table_name_1 WHERE inaugurated = "15 march 1930"
sql_create_context
CREATE TABLE table_name_49 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Result of the game on October 3?
SELECT result FROM table_name_49 WHERE date = "october 3"
sql_create_context
CREATE TABLE table_11813 ( "Year" real, "Competition" text, "Date" text, "Location" text, "Score" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of a year less than 2008 with loss as the result, in Antalya and a ...
SELECT "Score" FROM table_11813 WHERE "Year" < '2008' AND "Result" = 'loss' AND "Location" = 'antalya' AND "Competition" = 'europe/africa zone, group i, round robin'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND procedures.icd9_code = "93"
mimicsql_data
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 zzmzjzjlb ( HXPLC number, HZX...
SELECT jybgb.SHSJ FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '13818309' AND jybgb.BGRQ BETWEEN '2001-10-19' AND '2016-...
css
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Glycopyrrolate"
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 t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '华雨华' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_74780 ( "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 was the home team that scored 10.8 (68)?
SELECT "Home team" FROM table_74780 WHERE "Home team score" = '10.8 (68)'
wikisql
CREATE TABLE table_name_98 ( junctions VARCHAR, termini VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the junctions of the route with termini aguilares, texas us 59?
SELECT junctions FROM table_name_98 WHERE termini = "aguilares, texas us 59"
sql_create_context
CREATE TABLE table_18018248_2 ( club VARCHAR, draws VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which clubs had draws of 9?
SELECT club FROM table_18018248_2 WHERE draws = 9
sql_create_context
CREATE TABLE table_6841 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a Place of T2 and a Country listed as Fiji?
SELECT "Player" FROM table_6841 WHERE "Place" = 't2' AND "Country" = 'fiji'
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 prescriptions ( subject_id text, hadm_id...
SELECT demographic.discharge_location, demographic.dod FROM demographic WHERE demographic.subject_id = "8323"
mimicsql_data
CREATE TABLE table_68623 ( "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 score of the game on February 26 with the Chicago black hawks as the home team and the New York Ra...
SELECT "Score" FROM table_68623 WHERE "Home" = 'chicago black hawks' AND "Visitor" = 'new york rangers' AND "Date" = 'february 26'
wikisql
CREATE TABLE table_54941 ( "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. -- When the home team was geelong, what did the awa...
SELECT "Away team score" FROM table_54941 WHERE "Home team" = 'geelong'
wikisql
CREATE TABLE table_13310 ( "Number" real, "Sanskrit" text, "International Alphabet of Sanskrit Transliteration" text, "Sanskrit gloss" text, "Western name" text, "Greek" text, "Gloss" text, "Tattva (Element)" text, "Quality" text, "Ruling Planet" text ) -- Using valid SQLite, a...
SELECT "International Alphabet of Sanskrit Transliteration" FROM table_13310 WHERE "Sanskrit" = 'मेष'
wikisql
CREATE TABLE table_40402 ( "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. -- On October 14, 1996 who was the opponent in the final?
SELECT "Opponent in the final" FROM table_40402 WHERE "Date" = 'october 14, 1996'
wikisql
CREATE TABLE table_80385 ( "Team" text, "Manager" text, "Captain" text, "Kit manufacturer" text, "Shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which manager has Manchester City as the team?
SELECT "Manager" FROM table_80385 WHERE "Team" = 'manchester city'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '6366703' AND RYDJSJ BETWEEN '2012-11-27' AND '2015-06-06' AND WDBZ > 0
css