instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_44149 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record on the date of november 10, 1968?
SELECT "Record" FROM table_44149 WHERE "Date" = 'november 10, 1968'
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "27" AND diagnoses.short_title = "Intermed coronary synd"
mimicsql_data
CREATE TABLE table_name_35 ( principal_victims VARCHAR, nat VARCHAR, where_sunk VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the victims of the US ship that sank in the Mississippi River near Memphis?
SELECT principal_victims FROM table_name_35 WHERE nat = "us" AND where_sunk = "mississippi river near memphis"
sql_create_context
CREATE TABLE table_2953 ( "Competition" text, "Final position" text, "First match" text, "Last match" text, "Final Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the final position for copa libertadores
SELECT "Final position" FROM table_2953 WHERE "Competition" = 'Copa Libertadores'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '5821579' AND t_kc22.STA_DATE BETWEEN '2008-05-06' AND '2018-12-14' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_41 ( points INTEGER, chassis VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the highest points with a Chassis of gordini t16, and a Year smaller than 1954?
SELECT MAX(points) FROM table_name_41 WHERE chassis = "gordini t16" AND year < 1954
sql_create_context
CREATE TABLE enrolled_in ( stuid number, cid text, grade text ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE member_of ( facid number, dno number, appt_type text ) CREATE...
SELECT MAX(T2.gradepoint), MIN(T2.gradepoint) FROM enrolled_in AS T1 JOIN gradeconversion AS T2 JOIN student AS T3 ON T1.grade = T2.lettergrade AND T1.stuid = T3.stuid WHERE T3.city_code = "NYC"
spider
CREATE TABLE table_name_4 ( away_team VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Away team has a Score of 0 3?
SELECT away_team FROM table_name_4 WHERE score = "0–3"
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 COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '07777908' AND t_kc22.STA_DATE BETWEEN '2009-02-05' AND '2010-12-23' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE f...
css
CREATE TABLE table_13841 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Notes have a Year of 2002?
SELECT "Notes" FROM table_13841 WHERE "Year" = '2002'
wikisql
CREATE TABLE table_4918 ( "Lane" real, "Name" text, "Nationality" text, "50m Split" real, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Arkady Vyatchanin's time?
SELECT "Time" FROM table_4918 WHERE "Name" = 'arkady vyatchanin'
wikisql
CREATE TABLE table_44939 ( "Date" text, "Rank" real, "Weekend Gross" text, "Theaters" real, "Gross-to-date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Gross-to-date which has a Date of august 23 25?
SELECT "Gross-to-date" FROM table_44939 WHERE "Date" = 'august 23–25'
wikisql
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester...
advising
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 TagUsers.UserLink AS "user_link", TagUsers.Score AS Score, TagUsers.Count AS "count", (TagUsers.Score + TagUsers.Count) / 2.0 AS Total FROM (SELECT a.OwnerUserId AS UserLink, SUM(a.Score) / 10.0 AS Score, COUNT(a.Score) AS "count" FROM Posts AS a, Posts AS q INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JO...
sede
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) C...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
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 q.Id AS "post_link", q.CreationDate, COUNT(a.Id) AS answers, MAX(a.Score) AS max_score FROM Posts AS q LEFT JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND q.AcceptedAnswerId IS NULL AND q.Tags LIKE '%star-trek%' AND q.DeletionDate IS NULL AND q.ClosedDate IS NULL GROUP BY q.Id, q.CreationDate HA...
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.Y...
css
CREATE TABLE table_25818630_2 ( candidate VARCHAR, result____percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who as the candidate when the result - % was 2.9%?
SELECT candidate FROM table_25818630_2 WHERE result____percentage = "2.9%"
sql_create_context
CREATE TABLE table_51555 ( "Race" text, "Candidate" text, "Party" text, "Notes" text, "Votes" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the candidate in Race for State representative, hd18?
SELECT "Candidate" FROM table_51555 WHERE "Race" = 'state representative, hd18'
wikisql
CREATE TABLE table_19167 ( "State" text, "Highest point" text, "Highest elevation" text, "Lowest point" text, "Lowest elevation" text, "Mean elevation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the lowest elevation with highest point...
SELECT "Lowest elevation" FROM table_19167 WHERE "Highest point" = 'Charles Mound'
wikisql
CREATE TABLE table_1964010_2 ( opponents VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the opponents of Mike Byron and partner in matches where the score was 6 4, 4 6, 7 6 (7 4)?
SELECT opponents FROM table_1964010_2 WHERE score = "6–4, 4–6, 7–6 (7–4)"
sql_create_context
CREATE TABLE table_43145 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which men's singles had a women's doubles team of ...
SELECT "Men's singles" FROM table_43145 WHERE "Women's doubles" = 'irena ferencová / yweta trminková'
wikisql
CREATE TABLE table_15013825_8 ( team VARCHAR, copa_conmebol_1992 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team for copa conmebol 1992 is round of 16
SELECT team FROM table_15013825_8 WHERE copa_conmebol_1992 = "Round of 16"
sql_create_context
CREATE TABLE table_77989 ( "Date" text, "Ship" text, "Type" text, "Nationality" text, "Tonnage GRT" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the most tonnage grt of any ship sunk or captured on 16 jan 16?
SELECT MAX("Tonnage GRT") FROM table_77989 WHERE "Date" = '16 jan 16'
wikisql
CREATE TABLE table_name_2 ( height VARCHAR, date_of_birth VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How tall is the person born on 1976-12-27?
SELECT height FROM table_name_2 WHERE date_of_birth = "1976-12-27"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '59839403' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 2930.76)
css
CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) )...
SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code
nvbench
CREATE TABLE table_name_22 ( round INTEGER, player VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which round did Paul McDonald have an overall greater than 109?
SELECT MAX(round) FROM table_name_22 WHERE player = "paul mcdonald" AND overall > 109
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(SALARY)
nvbench
CREATE TABLE table_216776_2 ( municipality VARCHAR, population__2010_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What municipality had 26839 people living in it in 2010?
SELECT municipality FROM table_216776_2 WHERE population__2010_ = 26839
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID
nvbench
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 course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 500 AND 500 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = cou...
advising
CREATE TABLE table_204_801 ( id number, "year" number, "derby\nwinner" text, "galaxy" number, "draw" number, "chivas" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times has galaxy won the derby ?
SELECT COUNT(*) FROM table_204_801 WHERE "derby\nwinner" = 'galaxy'
squall
CREATE TABLE table_name_8 ( tournament VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament was played on May 29, 2010?
SELECT tournament FROM table_name_8 WHERE date = "may 29, 2010"
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Atherosclerosis of native arteries of the extremities with intermittent claudication" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_49275 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which visitor lives in Minnesota?
SELECT "Visitor" FROM table_49275 WHERE "Home" = 'minnesota'
wikisql
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city var...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
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 medication ( medi...
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-13959')) AND lab.labname = 'peep' AND STRFTIME('%y-%m', lab.labresulttime) >= '2104-...
eicu
CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machi...
SELECT Team, COUNT(*) FROM technician GROUP BY Team
nvbench
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26398) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 ...
mimic_iii
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828 AND admissions.dischtime IS NULL)) AND transfers....
mimic_iii
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.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzj...
css
CREATE TABLE table_name_52 ( success_rate VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the success rate for the year 2012?
SELECT success_rate FROM table_name_52 WHERE year = "2012"
sql_create_context
CREATE TABLE table_54151 ( "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. -- Where is the Venue that has an away team score o...
SELECT "Venue" FROM table_54151 WHERE "Away team score" = '13.16 (94)'
wikisql
CREATE TABLE table_2202 ( "Index (Year)" text, "Author / Editor / Source" text, "Year of publication" text, "Countries sampled" real, "World Ranking (1)" text, "Ranking L.A. (2)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many countries ...
SELECT MAX("Countries sampled") FROM table_2202 WHERE "Index (Year)" = 'Prosperity Index (2008)'
wikisql
CREATE TABLE table_name_79 ( population__2009_estimate_ VARCHAR, largest_city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2009 estimate population of the region with Manaus as the largest city?
SELECT population__2009_estimate_ FROM table_name_79 WHERE largest_city = "manaus"
sql_create_context
CREATE TABLE table_26713 ( "Legion no and title" text, "Main legion base" text, "Emblem" text, "Date founded/ founder" text, "Date disband" text, "Castra legionaria (legion bases) * = main base. Start date 31 BC if unspecified" text, "Notes" text ) -- Using valid SQLite, answer the followi...
SELECT "Main legion base" FROM table_26713 WHERE "Date disband" = '70 XX'
wikisql
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT department FROM course WHERE name LIKE '%The Good Life%'
advising
CREATE TABLE problem_log ( problem_log_id VARCHAR, log_entry_description VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all the log ids and their descriptions from the problem logs.
SELECT problem_log_id, log_entry_description FROM problem_log
sql_create_context
CREATE TABLE table_name_79 ( frequency INTEGER, website VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest frequency from uncionfeypoder.com?
SELECT MAX(frequency) FROM table_name_79 WHERE website = "uncionfeypoder.com"
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.days_stay > "16"
mimicsql_data
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 procedures.icd9_code, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Jonathan Wiggins"
mimicsql_data
CREATE TABLE table_20354_5 ( zodiac_sign VARCHAR, thai_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the zodiac sign for the month with Thai name ?
SELECT zodiac_sign FROM table_20354_5 WHERE thai_name = "มกราคม"
sql_create_context
CREATE TABLE table_75811 ( "Member State sorted by GDP" text, "GDP in s billion of USD (2012)" real, "GDP % of EU (2012)" text, "Annual change % of GDP (2012)" text, "GDP per capita in PPP US$ (2012)" real, "Public Debt % of GDP (2013 Q1)" real, "Deficit (-)/ Surplus (+) % of GDP (2012)" tex...
SELECT MAX("Inflation % Annual (2012)") FROM table_75811 WHERE "Public Debt % of GDP (2013 Q1)" > '88.2' AND "GDP % of EU (2012)" = '2.9%'
wikisql
CREATE TABLE table_26847237_3 ( home_team VARCHAR, opposition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the home team when the opposition is east coast?
SELECT home_team FROM table_26847237_3 WHERE opposition = "East Coast"
sql_create_context
CREATE TABLE table_203_611 ( id number, "player" text, "hr" number, "date reached 500 hr" text, "team" text, "seasons played" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which player has the highest number of career home runs ?
SELECT "player" FROM table_203_611 ORDER BY "hr" DESC LIMIT 1
squall
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 (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-29746')) AND lab.labname = 'direct bilirubin' AND lab.labresulttime = '2104...
eicu
CREATE TABLE table_name_23 ( title VARCHAR, podcast_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the episode that aired on September 25, 2005?
SELECT title FROM table_name_23 WHERE podcast_date = "september 25, 2005"
sql_create_context
CREATE TABLE table_24798 ( "District" text, "Municipalities" real, "Parishes" real, "Province of 1936" text, "Region" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the parishes for beira baixa province
SELECT COUNT("Parishes") FROM table_24798 WHERE "Province of 1936" = 'Beira Baixa Province'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE 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 WHERE demographic.admission_type = "NEWBORN" AND demographic.days_stay > "8"
mimicsql_data
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text,...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Place, Id AS "user_link", Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Thess%' OR Location LIKE '%Greece%' OR Location LIKE N'%Gr' OR (Location LIKE N'%Athens%' AND NOT Location LIKE N'%GA%') ORDER BY Reputation DESC LIMIT 1000
sede
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND procedures.icd9_code = "8857"
mimicsql_data
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYE...
SELECT HIRE_DATE, SALARY FROM employees ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_25302 ( "Station" text, "Line(s)" text, "City/Neighborhood" text, "Year opened" real, "Transit Connections" text, "Park and ride?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the transit connection in Columbia City, ...
SELECT "Transit Connections" FROM table_25302 WHERE "City/Neighborhood" = 'Columbia City, Seattle'
wikisql
CREATE TABLE table_34649 ( "Draw" real, "Singer" text, "Song" text, "Points" real, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the Points when the Place is 9?
SELECT "Points" FROM table_34649 WHERE "Place" = '9'
wikisql
CREATE TABLE table_name_71 ( bronze INTEGER, gold VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of bronze medals for nations with over 6 total and 2 golds?
SELECT MIN(bronze) FROM table_name_71 WHERE gold = 2 AND total > 6
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patie...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_17441 ( "Date" text, "Winning Team" text, "Score" text, "Winning Pitcher" text, "Losing Pitcher" text, "Attendance" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games were on May 20?
SELECT COUNT("Attendance") FROM table_17441 WHERE "Date" = 'May 20'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%Bengaluru%' OR UPPER(Location) LIKE '%Bengaluru%' OR Location LIKE '%Bengaluru%' OR LOWER(Location) LIKE '%Bangalore%' OR UPPER(Location) LIKE '%Bangalore%' OR Location LIKE '%Bang...
sede
CREATE TABLE Documents ( document_id INTEGER, document_type_code VARCHAR(10), grant_id INTEGER, sent_date DATETIME, response_received_date DATETIME, other_details VARCHAR(255) ) CREATE TABLE Tasks ( task_id INTEGER, project_id INTEGER, task_details VARCHAR(255), "eg Agree Object...
SELECT date_to, COUNT(date_to) FROM Project_Staff
nvbench
CREATE TABLE table_name_31 ( college_junior_club_team VARCHAR, position VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What College/junior/club team has a Position of centre, and pick is #22?
SELECT college_junior_club_team FROM table_name_31 WHERE position = "centre" AND pick__number = "22"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-17669') AND NOT patient.unitdischargetime IS NULL ORDER ...
eicu
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description ...
SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))
sede
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT YEAR(p.CreationDate) AS "year", MONTH(p.CreationDate) AS "month", DAY(p.CreationDate) AS "day", COUNT(*) AS "questionsaskedtoday" FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = @tagName GROUP BY YEAR(p.CreationDate), MONTH(p.CreationDate), ...
sede
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, d...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND...
atis
CREATE TABLE table_204_748 ( id number, "composer" text, "born" number, "died" number, "nationality" text, "notable works for piano" text, "remarks" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- tell me the number of french people on the li...
SELECT COUNT("composer") FROM table_204_748 WHERE "nationality" = 'french'
squall
CREATE TABLE table_59941 ( "Spaceport" text, "Launch complex" text, "Launcher" text, "Spacecraft" text, "Flights" text, "Years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which complex used the Soyuz (r) launcher to facilitate 14 orbital fli...
SELECT "Launch complex" FROM table_59941 WHERE "Launcher" = 'soyuz (r)' AND "Flights" = '14 orbital'
wikisql
CREATE TABLE table_5919 ( "Character" text, "French voice actor" text, "Italian voice actor" text, "German voice actor" text, "Spanish voice actor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which character has a French voice actor of Marc Saez ...
SELECT "Character" FROM table_5919 WHERE "French voice actor" = 'marc saez' AND "German voice actor" = 'dirk fenselau'
wikisql
CREATE TABLE table_name_86 ( emit__nm_ VARCHAR, mass__g_mol_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Emission (in nanometers) that has a molar mass of 1078 g/mol?
SELECT emit__nm_ FROM table_name_86 WHERE mass__g_mol_ = "1078"
sql_create_context
CREATE TABLE table_15944_5 ( effective_exhaust_velocity__m_s_ VARCHAR, scenario VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the effective exhaust velocity in a Space Shuttle Vacuum?
SELECT COUNT(effective_exhaust_velocity__m_s_) FROM table_15944_5 WHERE scenario = "Space shuttle vacuum"
sql_create_context
CREATE TABLE table_name_41 ( country VARCHAR, airport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country contains the Shanghai Pudong International airport?
SELECT country FROM table_name_41 WHERE airport = "shanghai pudong international airport"
sql_create_context
CREATE TABLE table_31560 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the date for bugatti fpr stanislas czaykowski
SELECT "Date" FROM table_31560 WHERE "Winning constructor" = 'bugatti' AND "Winning driver" = 'stanislas czaykowski'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, h...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id...
mimic_iii
CREATE TABLE table_57026 ( "Country" text, "Release Date" real, "Music Label" text, "Media" text, "Catalogue Number" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release date of the CD by EG Records in the UK?
SELECT SUM("Release Date") FROM table_57026 WHERE "Media" = 'cd' AND "Country" = 'uk' AND "Music Label" = 'eg records'
wikisql
CREATE TABLE fires ( fire_year number, discovery_date number, discovery_doy number, discovery_time text, stat_cause_code number, stat_cause_descr text, cont_date text, cont_doy text, cont_time text, fire_size number, fire_size_class text, latitude number, longitude nu...
SELECT owner_descr FROM fires GROUP BY owner_descr ORDER BY COUNT(*) DESC LIMIT 1
uswildfires
CREATE TABLE table_204_365 ( id number, "year" number, "single" text, "chart positions\nusa billboard hot dance club play" number, "chart positions\npolish charts" number, "album" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many singles w...
SELECT COUNT("single") FROM table_204_365 WHERE "year" = 2010
squall
CREATE TABLE table_59567 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has a Against larger than 13?
SELECT "Venue" FROM table_59567 WHERE "Against" > '13'
wikisql
CREATE TABLE table_name_38 ( goals_against INTEGER, played INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Goals Agains, when Played is greater than 34?
SELECT MIN(goals_against) FROM table_name_38 WHERE played > 34
sql_create_context
CREATE TABLE table_name_83 ( location VARCHAR, score VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the tallahassee open, with a Score of 269 ( 19)?
SELECT location FROM table_name_83 WHERE score = "269 (–19)" AND tournament = "tallahassee open"
sql_create_context
CREATE TABLE table_25246990_5 ( us_viewers__millions_ VARCHAR, no_in_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many U.S. viewers were there for the number 4 episode in season?
SELECT us_viewers__millions_ FROM table_25246990_5 WHERE no_in_season = 4
sql_create_context
CREATE TABLE table_8020 ( "Story #" text, "Title" text, "Doctor" text, "Narrator" text, "Format" text, "release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Available in 2-CD format, what is the title of story number 026?
SELECT "Title" FROM table_8020 WHERE "Format" = '2-cd' AND "Story #" = '026'
wikisql
CREATE TABLE table_name_64 ( current_status VARCHAR, make VARCHAR, number_of_seats VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the current status for GM Advanced Design with more than 41 seats?
SELECT current_status FROM table_name_64 WHERE make = "gm advanced design" AND number_of_seats > 41
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "7245" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId nu...
SELECT Id AS "user_link", Location, Reputation FROM Users WHERE AboutMe LIKE '%jesus%' OR AboutMe LIKE '%Jesus%' ORDER BY Reputation DESC
sede
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT AVG(t_kc22.SELF_PAY_PRO) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '3559148' AND t_kc22.STA_DATE BETWEEN '2000-01-13' AND '2001-06-15'
css
CREATE TABLE elimination ( elimination_id text, wrestler_id text, team text, eliminated_by text, elimination_move text, time text ) CREATE TABLE wrestler ( wrestler_id number, name text, reign text, days_held text, location text, event text ) -- Using valid SQLite, ans...
SELECT reign FROM wrestler GROUP BY reign ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, ...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-210868')) AND vitalperiodic.systemicsystolic BETWEEN systolic_bp...
eicu
CREATE TABLE table_14502 ( "Status" text, "Name" text, "First Performance" text, "Last Performance" text, "Style" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the First Performance of Rhys Kosakowski as Billy Elliot in the Orig...
SELECT "First Performance" FROM table_14502 WHERE "Status" = 'original cast' AND "Name" = 'rhys kosakowski'
wikisql
CREATE TABLE table_19007 ( "Rank" real, "Airport" text, "Total Passengers" real, "% Change 2007/2008" text, "International Passengers" real, "Domestic Passengers" real, "Transit Passengers" real, "Aircraft Movements" real, "Freight ( Metric Tonnes )" real ) -- Using valid SQLite, a...
SELECT "International Passengers" FROM table_19007 WHERE "Rank" = '15'
wikisql