instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE keyword ( id int, keyword text ) CREATE TABLE producer ( pid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE writer ( wid int, gender text, name text, nationality text, birth_city text, birth_year int ) ...
SELECT COUNT(DISTINCT (name)) FROM actor WHERE birth_city = 'New York City' AND birth_year > 1980 AND gender = 'female'
imdb
CREATE TABLE table_62481 ( "Name" text, "Score" text, "Balls" real, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Venue, when Balls is '148'?
SELECT "Venue" FROM table_62481 WHERE "Balls" = '148'
wikisql
CREATE TABLE table_dev_18 ( "id" int, "bleeding" int, "chronic_anticoagulant_therapy" bool, "renal_disease" bool, "hyperlipidemia" bool, "creatinine_clearance_cl" float, "chronic_hemostasis_disorders" bool, "significant_proteinuria" bool, "platelet_count" float, "total_cholestero...
SELECT * FROM table_dev_18 WHERE bleeding = 1 OR (platelet_count < 80000 OR inr > 1.5) OR chronic_hemostasis_disorders = 1 OR chronic_anticoagulant_therapy = 1 OR (heparin = 1 OR chronic_warfarin_therapy = 1)
criteria2sql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE labevents ( row_id number, sub...
SELECT COUNT(*) > 0 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 = 23760) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid IN (SELE...
mimic_iii
CREATE TABLE table_name_22 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- avg passengers in 2012 for 2009 more than 104.5 and 2010 less than 162.6 and 2011 less than 141.8 is what?
SELECT AVG(2012) FROM table_name_22 WHERE 2009 > 104.5 AND 2010 < 162.6 AND 2011 < 141.8
sql_create_context
CREATE TABLE table_49395 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the class when part 2 was *h t?
SELECT "Class" FROM table_49395 WHERE "Part 2" = '*hēt'
wikisql
CREATE TABLE table_12027364_1 ( mixed_doubles VARCHAR, mens_singles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the mixed doubles when ji xinpeng won the mens singles?
SELECT mixed_doubles FROM table_12027364_1 WHERE mens_singles = "Ji Xinpeng"
sql_create_context
CREATE TABLE table_60736 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a To par of 3, and a Player of santiago luna?
SELECT "Score" FROM table_60736 WHERE "To par" = '–3' AND "Player" = 'santiago luna'
wikisql
CREATE TABLE table_name_1 ( high_assists VARCHAR, game INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the high amount of assists before game 60?
SELECT high_assists FROM table_name_1 WHERE game < 60
sql_create_context
CREATE TABLE table_name_59 ( hanyu VARCHAR, area__km²_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Hanya has an area of 19.3888?
SELECT hanyu FROM table_name_59 WHERE area__km²_ = 19.3888
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 demographic.age, demographic.insurance FROM demographic WHERE demographic.subject_id = "31066"
mimicsql_data
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'incision of chest wall') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6440) AND ST...
mimic_iii
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 county FROM fires GROUP BY county ORDER BY COUNT(*)
uswildfires
CREATE TABLE table_87 ( "Country" text, "Players" real, "Standard" real, "Minor" real, "First title" real, "Last title" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year was the last last title received, by any of the countries?
SELECT MAX("Last title") FROM table_87
wikisql
CREATE TABLE table_66888 ( "Name" text, "Nickname" text, "Year" real, "Advantage" text, "Transmittance/ contrast ratio" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Ips-provectus transmittance/contrast ratio?
SELECT "Transmittance/ contrast ratio" FROM table_66888 WHERE "Name" = 'ips-provectus'
wikisql
CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8...
SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name
nvbench
CREATE TABLE table_name_72 ( date VARCHAR, outcome VARCHAR, surface VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Outcome is 'Winner', and when Surface is 'Grass'?
SELECT date FROM table_name_72 WHERE outcome = "winner" AND surface = "grass"
sql_create_context
CREATE TABLE customers ( email_address VARCHAR, phone_number VARCHAR, customer_id VARCHAR ) CREATE TABLE complaints ( email_address VARCHAR, phone_number VARCHAR, customer_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the email and ...
SELECT email_address, phone_number FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM complaints)
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewT...
SELECT YEAR(Posts.CreationDate) AS year, COUNT(Posts.Id) AS questions, SUM(Posts.AnswerCount) AS answers, COUNT(Posts.AcceptedAnswerId) AS closed, COUNT(DISTINCT Posts.OwnerUserId) AS users, SUM(Posts.ViewCount) AS views FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON Tags.Id = PostTags....
sede
CREATE TABLE table_name_70 ( nationality VARCHAR, lane VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nationality has a lane larger than 4 and a Time of 2:00.37?
SELECT nationality FROM table_name_70 WHERE lane > 4 AND time = "2:00.37"
sql_create_context
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 t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'lr' AND admissions.subject_id = 14836 AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-02') AS t1 JOIN (SELECT admissions.sub...
mimic_iii
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '严秀逸' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 3743.87)
css
CREATE TABLE table_18846 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" real, "Jockey" text, "Winner/2nd" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner of the...
SELECT "Winner/2nd" FROM table_18846 WHERE "Venue" = 'Belmont'
wikisql
CREATE TABLE table_5566 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the series ep for segment c of luxury cars (pa...
SELECT "Series Ep." FROM table_5566 WHERE "Segment C" = 'luxury cars (part 1)'
wikisql
CREATE TABLE table_name_71 ( rank INTEGER, bronze VARCHAR, silver VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest rank for a nation with 29 total medals, over 5 silvers, and under 16 bronze?
SELECT MIN(rank) FROM table_name_71 WHERE silver > 5 AND total = 29 AND bronze < 16
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Sc...
SELECT SUM(CASE WHEN v.VoteTypeId = 2 THEN 10 ELSE -2 END) AS "reputation_earned" FROM Votes AS v INNER JOIN Posts AS p ON v.PostId = p.Id WHERE p.OwnerUserId = '##UserId##' AND p.Id = '##PostId##' AND v.VoteTypeId IN (2, 3)
sede
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid numb...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-143187')) AND vitalperiodic.respiration < 11.0 ...
eicu
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm_amenity ( amenid ...
SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex ORDER BY COUNT(*)
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "4610"
mimicsql_data
CREATE TABLE table_35072 ( "Player" text, "Played" real, "Sets Won" real, "Sets Lost" real, "Legs Won" real, "Legs Lost" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" real ) -- Using valid SQLite, answer the following questions for the ...
SELECT SUM("Played") FROM table_35072 WHERE "Sets Won" < '4' AND "3-dart Average" = '53.19'
wikisql
CREATE TABLE table_name_48 ( result VARCHAR, couple VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Result for Couple Kelly & Alec when they have a Score of 22 (8, 7, 7)?
SELECT result FROM table_name_48 WHERE couple = "kelly & alec" AND score = "22 (8, 7, 7)"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT u.Id AS "user_link", MIN(Reputation) AS rep FROM Users AS u INNER JOIN Badges AS b ON b.UserId = u.Id WHERE Reputation > 1 GROUP BY u.Id HAVING COUNT(*) = 100 ORDER BY MIN(Reputation)
sede
CREATE TABLE table_train_133 ( "id" int, "vascular" bool, "interferon_alpha" bool, "pulmonary_disease" bool, "mini_mental_state_examination_mmse" int, "cardiac" bool, "neuropsychological_testing" bool, "clinical_dementia_rating_scale" float, "rituximab" bool, "hematologic_disease...
SELECT * FROM table_train_133 WHERE amnestic_mild_cognitive_impairment = 1 OR alzheimer_disease_ad = 1 OR cognitive_impairment = 0
criteria2sql
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType
nvbench
CREATE TABLE gsi ( course_offering_id int, student_id int ) 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, ...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%LING%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
advising
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, ...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 GROUP BY date
nvbench
CREATE TABLE table_name_16 ( position VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position has ronjay buenafe as the name?
SELECT position FROM table_name_16 WHERE name = "ronjay buenafe"
sql_create_context
CREATE TABLE table_31864 ( "Year" real, "Chinese Title" text, "English Title" text, "Role" text, "Character" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the average year of
SELECT AVG("Year") FROM table_31864 WHERE "Chinese Title" = '敗犬女王'
wikisql
CREATE TABLE table_name_80 ( altitude__ft_ INTEGER, mach VARCHAR, duration VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest altitude of the flight with a mach bigger than 0.905 and a duration of 00:06:17?
SELECT MIN(altitude__ft_) FROM table_name_80 WHERE mach > 0.905 AND duration = "00:06:17"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE IN_DIAG_DIS_CD = 'J69.249'
css
CREATE TABLE table_54453 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What PBA team is the player from Ateneo college with a pick number smaller than 15 from?
SELECT "PBA team" FROM table_54453 WHERE "Pick" < '15' AND "College" = 'ateneo'
wikisql
CREATE TABLE table_name_86 ( pole_position VARCHAR, grand_prix VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the pole at the French Grand Prix?
SELECT pole_position FROM table_name_86 WHERE grand_prix = "french grand prix"
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '吴映秋' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2009-10-09')
css
CREATE TABLE table_name_16 ( antiparticle_symbol VARCHAR, rest_mass___mev___c_2__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the antiparticle symbol with a rest mess (mev/c2) of .47 .33?
SELECT antiparticle_symbol FROM table_name_16 WHERE rest_mass___mev___c_2__ = ".47 ± .33"
sql_create_context
CREATE TABLE table_name_60 ( round INTEGER, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round that has a draftee from Washington State University?
SELECT MAX(round) FROM table_name_60 WHERE school = "washington state university"
sql_create_context
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 COUNT(*) FROM mzjzjlb WHERE mzjzjlb.ZZYSGH = '70900015' AND mzjzjlb.JZKSRQ BETWEEN '2001-09-15' AND '2009-07-27'
css
CREATE TABLE table_name_25 ( attendance VARCHAR, visitor VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total attendance at games when Detroit was the visiting team and the record was 36 13 5?
SELECT COUNT(attendance) FROM table_name_25 WHERE visitor = "detroit" AND record = "36–13–5"
sql_create_context
CREATE TABLE table_name_28 ( away VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The Club of Ekranas was an away with a score of what?
SELECT away FROM table_name_28 WHERE club = "ekranas"
sql_create_context
CREATE TABLE table_47779 ( "Rank" real, "Company" text, "Headquarters" text, "Industry" text, "Sales (billion $)" real, "Profits (billion $)" real, "Assets (billion $)" real, "Market Value (billion $)" real ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT AVG("Rank") FROM table_47779 WHERE "Headquarters" = 'usa' AND "Market Value (billion $)" > '407.2'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int...
SELECT DISTINCT name, number FROM course WHERE credits = 6 AND department = 'EECS'
advising
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '喻英朗'
css
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT t.TagName, COUNT(a.Id) AS NumAnswers, SUM(a.Score) AS TotalScore, AVG(a.Score + 0.0) AS AvgScore FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id JOIN PostTags AS pt ON pt.PostId = q.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE a.PostTypeId = 2 GROUP BY t.TagName, t.Id HAVING COUNT(a.Id) >= 1000 ORDER BY AvgSc...
sede
CREATE TABLE table_name_18 ( runner_up VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Runner-up of a Year in 1963?
SELECT runner_up FROM table_name_18 WHERE year = 1963
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '43929858' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_name_46 ( date VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the date when the tie no is 9?
SELECT date FROM table_name_46 WHERE tie_no = "9"
sql_create_context
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 * FROM jybgb WHERE JZLSH = '91187445953'
css
CREATE TABLE table_name_66 ( wins INTEGER, events INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of wins when the evens is less than 3?
SELECT SUM(wins) FROM table_name_66 WHERE events < 3
sql_create_context
CREATE TABLE table_31603 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the venue for year less than 2003
SELECT "Venue" FROM table_31603 WHERE "Year" < '2003'
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.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Non-invasive mech vent"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE i...
SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-2498') AND NOT patient.unitdischargetime IS NULL O...
eicu
CREATE TABLE table_204_910 ( id number, "rank" number, "name" text, "nationality" text, "result" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many points apart were the 1st place competitor and the 12th place competitor ?
SELECT (SELECT "result" FROM table_204_910 WHERE id = 1) - (SELECT "result" FROM table_204_910 WHERE id = 12)
squall
CREATE TABLE table_73434 ( "P" real, "Player" text, "League" real, "Scottish Cup" real, "League Cup" real, "Challenge Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is bryan hodge's player number
SELECT COUNT("P") FROM table_73434 WHERE "Player" = 'Bryan Hodge'
wikisql
CREATE TABLE table_name_64 ( pos VARCHAR, year VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pos from 2003, and the f event?
SELECT pos FROM table_name_64 WHERE year = "2003" AND event = "f"
sql_create_context
CREATE TABLE table_name_49 ( location VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the location of the home game for Japan?
SELECT location FROM table_name_49 WHERE home_team = "japan"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
mimic_iii
CREATE TABLE table_27712180_13 ( date VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of game #3?
SELECT date FROM table_27712180_13 WHERE game = 3
sql_create_context
CREATE TABLE table_23050383_1 ( country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2008 rank of Djibouti?
SELECT 2008 AS _rank FROM table_23050383_1 WHERE country = "Djibouti"
sql_create_context
CREATE TABLE table_name_30 ( date_from VARCHAR, date_to VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Date From for Theo Robinson, who was with the team until the end of season?
SELECT date_from FROM table_name_30 WHERE date_to = "end of season" AND name = "theo robinson"
sql_create_context
CREATE TABLE table_37711 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest round that Adam Wiesel was picked?
SELECT MIN("Round") FROM table_37711 WHERE "Player" = 'adam wiesel'
wikisql
CREATE TABLE table_name_78 ( win__percentage INTEGER, year VARCHAR, coach VARCHAR, crew VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of win % when John Gartin is coach, the crew is varsity 8+, and the year is 2005?
SELECT SUM(win__percentage) FROM table_name_78 WHERE coach = "john gartin" AND crew = "varsity 8+" AND year = "2005"
sql_create_context
CREATE TABLE Departments ( department_id INTEGER, dept_store_id INTEGER, department_name VARCHAR(80) ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(10), order_date DATETIME ) CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER...
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code
nvbench
CREATE TABLE table_name_41 ( location VARCHAR, runners_up VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location when France was the runner-up at club de campo?
SELECT location FROM table_name_41 WHERE runners_up = "france" AND venue = "club de campo"
sql_create_context
CREATE TABLE table_name_18 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance during the november 16, 1975 game?
SELECT MAX(attendance) FROM table_name_18 WHERE date = "november 16, 1975"
sql_create_context
CREATE TABLE table_55474 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins for bruce fleisher with over 31 events?
SELECT AVG("Wins") FROM table_55474 WHERE "Player" = 'bruce fleisher' AND "Events" > '31'
wikisql
CREATE TABLE table_76065 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On November 20, 1994, what was the result of the game?
SELECT "Result" FROM table_76065 WHERE "Date" = 'november 20, 1994'
wikisql
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
(SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = ...
css
CREATE TABLE table_name_4 ( round VARCHAR, player VARCHAR, pick VARCHAR, draft VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round was Player Adam Cracknell Picked after 231 in a Draft year after 1988?
SELECT round FROM table_name_4 WHERE pick > 231 AND draft > 1988 AND player = "adam cracknell"
sql_create_context
CREATE TABLE table_48479 ( "Team 1" text, "Score" text, "Team 2" text, "1st round" text, "2nd round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2nd round with a score of 3 - 3, and a team 1 fc gueugnon (d2)?
SELECT "2nd round" FROM table_48479 WHERE "Score" = '3 - 3' AND "Team 1" = 'fc gueugnon (d2)'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE...
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 program_course ON program_course.course_id = course_offering.course_id INN...
advising
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Laryngotrach anomaly NEC" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_21756039_1 ( year VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which year is the overall 29-4?
SELECT year FROM table_21756039_1 WHERE overall = "29-4"
sql_create_context
CREATE TABLE table_11372 ( "Year" real, "Team" text, "League" text, "Record" text, "Finish" text, "Organization" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which record has a Team of manchester yankees?
SELECT "Record" FROM table_11372 WHERE "Team" = 'manchester yankees'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.age < "67"
mimicsql_data
CREATE TABLE table_26081 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games did they play the carolina hurr...
SELECT COUNT("Game") FROM table_26081 WHERE "Opponent" = 'Carolina Hurricanes'
wikisql
CREATE TABLE table_name_86 ( score VARCHAR, winner VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score when the winner was suntory sungoliath, and the number attendance was n/a?
SELECT score FROM table_name_86 WHERE winner = "suntory sungoliath" AND attendance = "n/a"
sql_create_context
CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE status ( station_id number, bikes_available number, docks_available number, time text ) CREATE TABLE weather ( date text, max_te...
SELECT city, MAX(lat) FROM station GROUP BY city
spider
CREATE TABLE financial_transactions ( transaction_id number, account_id number, invoice_number number, transaction_type text, transaction_date time, transaction_amount number, transaction_comment text, other_transaction_details text ) CREATE TABLE accounts ( account_id number, c...
SELECT COUNT(*) FROM accounts
spider
CREATE TABLE county_public_safety ( county_id number, name text, population number, police_officers number, residents_per_officer number, case_burden number, crime_rate number, police_force text, location text ) CREATE TABLE city ( city_id number, county_id number, name ...
SELECT name FROM city ORDER BY name
spider
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 diagnoses ( ...
SELECT demographic.gender, demographic.insurance FROM demographic WHERE demographic.name = "Jesse Ran"
mimicsql_data
CREATE TABLE table_43435 ( "Locomotive number" text, "Model" text, "Type" text, "Propulsion" text, "Manufacturer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type is locomotive number CTN 46?
SELECT "Type" FROM table_43435 WHERE "Locomotive number" = 'ctn 46'
wikisql
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALA...
SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER
nvbench
CREATE TABLE table_name_15 ( population VARCHAR, gdp_per_capita__us$_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total population of the country that has a GDP per capita (US$) of 15,054?
SELECT population FROM table_name_15 WHERE gdp_per_capita__us$_ = "15,054"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
SELECT DATE(Posts.CreationDate) AS data, COUNT(*) AS ile FROM Posts WHERE Posts.CreationDate < '2019-01-07' AND Posts.CreationDate > '2019-01-01' GROUP BY DATE(Posts.CreationDate)
sede
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents...
SELECT (SELECT chartevents.valuenum 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 = 1372) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemi...
mimic_iii
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE writes ( paperid int, authori...
SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'Peter Mertens' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_60352 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1st leg with Team 2 Lyon?
SELECT "1st leg" FROM table_60352 WHERE "Team 2" = 'lyon'
wikisql
CREATE TABLE table_name_78 ( player VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player had a To par of 13?
SELECT player FROM table_name_78 WHERE to_par = 13
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, ...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
advising
CREATE TABLE table_11662133_3 ( date_entered_service VARCHAR, ships_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the date where ships name is zeeland entered service
SELECT date_entered_service FROM table_11662133_3 WHERE ships_name = "Zeeland"
sql_create_context
CREATE TABLE table_50478 ( "Player" text, "Team" text, "Matches" real, "Overs" real, "Economy Rate" real, "Wickets" real, "Average" real, "Strike Rate" real, "Best Bowling" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the l...
SELECT MIN("Overs") FROM table_50478 WHERE "Team" = 'royal challengers bangalore'
wikisql