instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_204_98 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many many competitions were held in 2006 ?
SELECT COUNT("competition") FROM table_204_98 WHERE "year" = 2006
squall
CREATE TABLE table_58565 ( "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. -- Who was the home team when Fitzroy was the away ...
SELECT "Home team" FROM table_58565 WHERE "Away team" = 'fitzroy'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id nu...
SELECT Posts.OwnerUserId AS "user_link", COUNT(*) AS Num FROM Posts INNER JOIN Votes ON Votes.PostId = Posts.Id INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Votes.VoteTypeId = 1 AND Posts.PostTypeId = 2 GROUP BY Posts.OwnerUserId ORDER BY Num DESC
sede
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "7" AND procedures.icd9_code = "9703"
mimicsql_data
CREATE TABLE table_name_35 ( surface VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the surface for the game that was played with partner Tiya Rolle?
SELECT surface FROM table_name_35 WHERE partner = "tiya rolle"
sql_create_context
CREATE TABLE table_name_8 ( arena VARCHAR, capacity VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which arena has a capactiy of 1,100?
SELECT arena FROM table_name_8 WHERE capacity = "1,100"
sql_create_context
CREATE TABLE table_13018116_1 ( pts_for INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most points for
SELECT MIN(pts_for) FROM table_13018116_1
sql_create_context
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY bedType DESC
nvbench
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) 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, g...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%EECS%' AND program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id
advising
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 demographic.gender, prescriptions.drug_type FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
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.marital_status = "MARRIED" AND diagnoses.short_title = "Poison-drug/medicin NEC"
mimicsql_data
CREATE TABLE table_10317 ( "Sport" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the sum of bronze for gold being 27 and silver more than 30
SELECT SUM("Bronze") FROM table_10317 WHERE "Gold" = '27' AND "Silver" > '30'
wikisql
CREATE TABLE table_37797 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the name for men's featherweight and sport of weightlifting
SELECT "Name" FROM table_37797 WHERE "Event" = 'men''s featherweight' AND "Sport" = 'weightlifting'
wikisql
CREATE TABLE table_10514 ( "Edition" real, "Year" real, "Winner" text, "Runner-up" text, "Third" text, "Fourth" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the sum of year for edition more than 4 and winners of new york red bulls
SELECT SUM("Year") FROM table_10514 WHERE "Edition" > '4' AND "Winner" = 'new york red bulls'
wikisql
CREATE TABLE table_70012 ( "Date" text, "City" text, "Country" text, "Venue" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is Country of united states, and a Venue of mandalay bay resort in?
SELECT "Date" FROM table_70012 WHERE "Country" = 'united states' AND "Venue" = 'mandalay bay resort'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'lipase')
eicu
CREATE TABLE table_name_88 ( club VARCHAR, goals_for VARCHAR, draws VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club has less than 8 draws, 37 points, and less than 71 goals?
SELECT club FROM table_name_88 WHERE draws < 8 AND points = 37 AND goals_for < 71
sql_create_context
CREATE TABLE table_5292 ( "Season" text, "Champion" text, "Constructor" text, "Teams' Champion" text, "Secondary Class" text, "Nations Cup" text, "Winter Series Champion" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season has the cha...
SELECT "Season" FROM table_5292 WHERE "Champion" = 'nicolas kiesa'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT * FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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 AND jybgb.YLJGDM = jy...
css
CREATE TABLE table_name_37 ( date VARCHAR, score VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the score 1-2 at Athens Olympic Stadium?
SELECT date FROM table_name_37 WHERE score = "1-2" AND venue = "athens olympic stadium"
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 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.IN_DIAG_DIS_CD = 'L27.784'
css
CREATE TABLE table_37192 ( "Name" text, "Type" text, "Entered service" text, "Water depth" text, "Location" text, "Customer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the water depth that entered service in 2001 named Cajun Express...
SELECT "Water depth" FROM table_37192 WHERE "Entered service" = '2001' AND "Name" = 'cajun express'
wikisql
CREATE TABLE table_70520 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the match with a result of sa by 10 wkts?
SELECT "Date" FROM table_70520 WHERE "Result" = 'sa by 10 wkts'
wikisql
CREATE TABLE table_71231 ( "Capital" text, "Prefecture" text, "Region" text, "Island" text, "Pop. \u00b9" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average pop for ch goku and prefecture of okayama
SELECT AVG("Pop. \u00b9") FROM table_71231 WHERE "Region" = 'chūgoku' AND "Prefecture" = 'okayama'
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 MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '花古香' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE SOC_SRT_DIRE_CD = '971102-f')
css
CREATE TABLE table_20360535_3 ( no VARCHAR, directed_by VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes directed by ben jones and written by paul dini?
SELECT COUNT(no) FROM table_20360535_3 WHERE directed_by = "Ben Jones" AND written_by = "Paul Dini"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND STRFTIME('%y', diagnosis.diagnosistime) = '2103' GROUP BY diagnosis.d...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "SHORT TERM HOSPITAL"
mimicsql_data
CREATE TABLE table_name_79 ( partner VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Partner has a Score of 6 7, 7 6, 6 7?
SELECT partner FROM table_name_79 WHERE score = "6–7, 7–6, 6–7"
sql_create_context
CREATE TABLE table_name_28 ( draws INTEGER, goals_for VARCHAR, goals_against VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Draws has Goals against smaller than 47, and a Position smaller than 13, and Goals for of 52?
SELECT MIN(draws) FROM table_name_28 WHERE goals_against < 47 AND position < 13 AND goals_for = 52
sql_create_context
CREATE TABLE table_19311 ( "Team" text, "Average" text, "Points" real, "Played" real, "1989-90" text, "1990-91" text, "1991-1992" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 1991-1992 for river plate
SELECT "1991-1992" FROM table_19311 WHERE "Team" = 'River Plate'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, COUNT(Name) FROM Products WHERE Price <= 200 GROUP BY Name
nvbench
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '喻星海' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID...
css
CREATE TABLE table_72530 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most touchdowns for becker
SELECT MAX("Touchdowns") FROM table_72530 WHERE "Player" = 'Becker'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( ...
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 67468)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'pericardial' A...
mimic_iii
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-13531') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_20215 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were all the pictorials when the centerfold model...
SELECT COUNT("Pictorials") FROM table_20215 WHERE "Centerfold model" = 'Rebekka Armstrong'
wikisql
CREATE TABLE table_18993 ( "Country/Region" text, "Local title" text, "Television network" text, "Seasons and winners" text, "Judges" text, "Presenters" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the country/region with presenters bei...
SELECT "Country/Region" FROM table_18993 WHERE "Presenters" = 'Heikki Paasonen Jukka Rossi (Xtra Factor)'
wikisql
CREATE TABLE table_name_35 ( bronze VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won bronze in 2002?
SELECT bronze FROM table_name_35 WHERE year = 2002
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "71" AND lab.itemid = "50818"
mimicsql_data
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'E21.594' AND jyjgzbb.JCZBMC = '降钙素原' UNION SELECT jyjgzbb.CKZFWX...
css
CREATE TABLE table_name_41 ( d_42 VARCHAR, r_51 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the D 42 with R 51 of r 11
SELECT d_42 FROM table_name_41 WHERE r_51 = "r 11"
sql_create_context
CREATE TABLE table_70365 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sum of silver when total is mor ethan 1, bronze is 1 and gold is les than 0
SELECT SUM("Silver") FROM table_70365 WHERE "Total" > '1' AND "Bronze" = '1' AND "Gold" < '0'
wikisql
CREATE TABLE table_55096 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team played as the home team when north me...
SELECT "Home team" FROM table_55096 WHERE "Away team" = 'north melbourne'
wikisql
CREATE TABLE table_name_41 ( total INTEGER, player VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Gary Player's highest total when his To par was over 15?
SELECT MAX(total) FROM table_name_41 WHERE player = "gary player" AND to_par > 15
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
nvbench
CREATE TABLE table_name_77 ( position VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Position, when Team is Cincinnati Royals?
SELECT position FROM table_name_77 WHERE team = "cincinnati royals"
sql_create_context
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "V1582" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_name_91 ( income_inequality_1994_2011__latest_available_ VARCHAR, population_2011 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest available income inequality for the country with a population of 21,315,135?
SELECT income_inequality_1994_2011__latest_available_ FROM table_name_91 WHERE population_2011 = "21,315,135"
sql_create_context
CREATE TABLE table_31140 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes are titl...
SELECT COUNT("No. in season") FROM table_31140 WHERE "Title" = 'Dick''s Big Giant Headache (Part 1)'
wikisql
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 m...
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
eicu
CREATE TABLE table_name_72 ( distance VARCHAR, course VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the distance for the course Civitavecchia to San Vincenzo?
SELECT distance FROM table_name_72 WHERE course = "civitavecchia to san vincenzo"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN 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 = jy...
css
CREATE TABLE table_203_35 ( id number, "pos" text, "rider" text, "manufacturer" text, "time/retired" text, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what manufacturer is listed for max biaggi and marcellino lucchi ?
SELECT "manufacturer" FROM table_203_35 WHERE "rider" = 'max biaggi'
squall
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, ...
SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cardiac tamponade') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624 AND admissions.dis...
mimic_iii
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
SELECT t_kc22.CHA_ITEM_LEV 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 = '46298054925' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸氟西汀片'
css
CREATE TABLE table_dev_56 ( "id" int, "anemia" bool, "gender" string, "white_blood_cell_count_wbc" int, "hemoglobinopathy" bool, "major_hematological_conditions" bool, "laboratory_abnormality" bool, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "hematocrit_hct" float, "...
SELECT * FROM table_dev_56 WHERE renal_disease = 0 OR (serum_creatinine < 1.5 AND gender = 'male') OR (serum_creatinine < 1.2 AND gender = 'female')
criteria2sql
CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year ...
SELECT Country, COUNT(Country) FROM people WHERE Age < (SELECT AVG(Age) FROM people) GROUP BY Country
nvbench
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 PostTags ( PostId number, TagId number ) CREATE TABLE R...
SELECT Id, Title + REPLACE(REPLACE(Tags, '<', ' '), '>', ' ') + REPLACE(REPLACE(Body, CHAR(13), ''), CHAR(10), '') AS txt FROM Posts WHERE CreationDate > '2000-01-01' AND (Title LIKE '%java%' OR Body LIKE '%java%' OR Tags LIKE '%java%') AND (Body LIKE '%performance%' OR Body LIKE '%better%' OR Body LIKE '%efficient%' O...
sede
CREATE TABLE time_slot ( time_slot_id text, day text, start_hr number, start_min number, end_hr number, end_min number ) CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE classroom ( building text, room_number text, capacity n...
SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math' ORDER BY T3.tot_cred
spider
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Road, Team_ID FROM basketball_match ORDER BY All_Road DESC
nvbench
CREATE TABLE table_40366 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of silvers associated with 3 bronzes, a total over 6, and a rank of...
SELECT COUNT("Silver") FROM table_40366 WHERE "Bronze" = '3' AND "Rank" = '3' AND "Total" > '6'
wikisql
CREATE TABLE table_11714 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent has a Date of september 28, 1951?
SELECT "Opponent" FROM table_11714 WHERE "Date" = 'september 28, 1951'
wikisql
CREATE TABLE customers ( customer_id number, customer_first_name text, customer_last_name text, customer_address text, customer_phone text, customer_email text, other_customer_details text ) CREATE TABLE accounts ( account_id number, customer_id number, account_name text, ot...
SELECT DISTINCT transaction_type FROM financial_transactions
spider
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_ORG_DEPT_CD, IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '7880116' GROUP BY MED_ORG_DEPT_CD, IN_DIAG_DIS_CD
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.age >= "70" AND demographic.admityear >= "2194"
mimicsql_data
CREATE TABLE table_50710 ( "Appearances" real, "School" text, "Wins" real, "Losses" real, "Percent" text, "Last Appearance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Last Appearance, when Wins is less than 1, when Losses is 1, and w...
SELECT "Last Appearance" FROM table_50710 WHERE "Wins" < '1' AND "Losses" = '1' AND "School" = 'oklahoma state'
wikisql
CREATE TABLE table_1539201_1 ( february VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of februaries
SELECT COUNT(february) FROM table_1539201_1
sql_create_context
CREATE TABLE table_name_50 ( time INTEGER, lane VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the time of Britta Steffen in a lane less than 4?
SELECT SUM(time) FROM table_name_50 WHERE lane < 4 AND name = "britta steffen"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'joint fluid' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
mimic_iii
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-17834')) AND DATETIME(microlab.culturetakentime, 'start of year') ...
eicu
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-78423')) AND intakeoutput.celllabel = 'propo...
eicu
CREATE TABLE table_78806 ( "Geelong DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of wins where the losses are more than 12 and the draws are ...
SELECT MIN("Wins") FROM table_78806 WHERE "Losses" > '12' AND "Draws" < '0'
wikisql
CREATE TABLE table_name_44 ( jockey VARCHAR, horse VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who rode mad rush?
SELECT jockey FROM table_name_44 WHERE horse = "mad rush"
sql_create_context
CREATE TABLE table_name_5 ( founded INTEGER, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- COunt the Founded which has a Venue of villa park?
SELECT SUM(founded) FROM table_name_5 WHERE venue = "villa park"
sql_create_context
CREATE TABLE table_12962773_13 ( no VARCHAR, current_club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of grupo capitol valladolid
SELECT COUNT(no) FROM table_12962773_13 WHERE current_club = "Grupo Capitol Valladolid"
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2165.0" AND procedures.short_title = "Heart countershock NEC"
mimicsql_data
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
SELECT Date, SUM(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY Date DESC
nvbench
CREATE TABLE table_name_66 ( pick__number INTEGER, name VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the pick number for Deji Karim, in a round lower than 6?
SELECT AVG(pick__number) FROM table_name_66 WHERE name = "deji karim" AND round < 6
sql_create_context
CREATE TABLE table_train_175 ( "id" int, "lipid_lowering_therapy" bool, "hemoglobin_a1c_hba1c" float, "diabetic" string, "fasting_serum_triglycerides" int, "gilbert_syndrome" bool, "age" float, "alanine_aminotransferase" bool, "NOUSE" float ) -- Using valid SQLite, answer the follo...
SELECT * FROM table_train_175 WHERE age >= 18
criteria2sql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA"
mimicsql_data
CREATE TABLE table_26535 ( "World record" text, "Kenenisa Bekele ( ETH )" text, "12:37.35" text, "Hengelo , Netherlands" text, "31 May 2004" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times is kenenisa bekele ( eth ) is mar lson gomes d...
SELECT COUNT("World record") FROM table_26535 WHERE "Kenenisa Bekele ( ETH )" = 'Marílson Gomes dos Santos ( BRA )'
wikisql
CREATE TABLE Procedures ( Code INTEGER, Name VARCHAR(30), Cost REAL ) CREATE TABLE Nurse ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), Registered BOOLEAN, SSN INTEGER ) CREATE TABLE Stay ( StayID INTEGER, Patient INTEGER, Room INTEGER, StayStart DATETIME...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY COUNT(*) DESC
nvbench
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 zzmzjzjlb.MZZYZDZZBM, zzmzjzjlb.MZZYZDZZMC FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '14585277536' UNION SELECT fzzmzjzjlb.MZZYZDZZBM, fzzmzjzjlb.MZZYZDZZMC FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '14585277536'
css
CREATE TABLE table_7451 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has a School/Club Team of illinois?
SELECT "Position" FROM table_7451 WHERE "School/Club Team" = 'illinois'
wikisql
CREATE TABLE table_204_635 ( id number, "round" number, "selection" number, "player" text, "position" text, "college" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the last de player ?
SELECT "player" FROM table_204_635 WHERE "position" = 'de' ORDER BY id DESC LIMIT 1
squall
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price) DESC
nvbench
CREATE TABLE table_13091 ( "Municipality" text, "Inhabitants" real, "Mayor" text, "Party" text, "Election" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest election that has cinisello balsamo as the municipality?
SELECT MIN("Election") FROM table_13091 WHERE "Municipality" = 'cinisello balsamo'
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 demographic.diagnosis, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE Flight ( price INTEGER, origin VARCHAR, destination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average price for flights from Los Angeles to Honolulu.
SELECT AVG(price) FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu"
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '窦红旭' AND t_kc22.STA_DATE BETWEEN '2001-02-24' AND '2002-07-05' AND t_kc21.MED_SER_ORG_NO = '9046567' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_name_2 ( date VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date was game 35 on?
SELECT date FROM table_name_2 WHERE game = 35
sql_create_context
CREATE TABLE table_name_82 ( time VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want to know the time which has attendance of 66,772
SELECT time FROM table_name_82 WHERE attendance = "66,772"
sql_create_context
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 MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H"
mimicsql_data
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code
nvbench
CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE domain ( did int, name varchar ) CREATE TABLE keyword ( keyword varchar, kid int ) CREATE TABLE publication ( abstract varchar, cid int, c...
SELECT COUNT(DISTINCT (journal.name)) FROM author, journal, publication, writes WHERE author.name = 'H. V. Jagadish' AND publication.jid = journal.jid AND writes.aid = author.aid AND writes.pid = publication.pid
academic
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41152')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_TIME(),...
eicu
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, ...
SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 43959) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1
mimic_iii
CREATE TABLE addresses ( address_id number, line_1 text, line_2 text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE students ( student_id number, student_details text ) CREATE TABLE people ( person_id number, first_name text, midd...
SELECT student_id FROM student_course_attendance WHERE course_id = 301
spider
CREATE TABLE table_18482 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the result for district ohio 2
SELECT "Result" FROM table_18482 WHERE "District" = 'Ohio 2'
wikisql