instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_77051 ( "Team" text, "Manager" text, "Home city" text, "Stadium" text, "Capacity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team has a home city of Velika?
SELECT "Team" FROM table_77051 WHERE "Home city" = 'velika'
wikisql
CREATE TABLE customers ( customer_id number, customer_name text ) CREATE TABLE services ( service_id number, service_name text ) CREATE TABLE first_notification_of_loss ( fnol_id number, customer_id number, policy_id number, service_id number ) CREATE TABLE settlements ( settlemen...
SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" OR t3.service_name = "Upgrade a policy"
spider
CREATE TABLE table_71385 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which was the position for overall less than 254, round less than 5 and pick number le...
SELECT "Position" FROM table_71385 WHERE "Overall" < '254' AND "Round" < '5' AND "Pick #" < '13'
wikisql
CREATE TABLE table_name_22 ( release_date VARCHAR, dvd_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release date for Ben 10: Alien Force Volume 9 on DVD?
SELECT release_date FROM table_name_22 WHERE dvd_title = "ben 10: alien force volume 9"
sql_create_context
CREATE TABLE table_204_636 ( id number, "season" text, "tier" number, "division" text, "pos." text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what tier was this team placed into next after their 2011-2012 season ?
SELECT "tier" FROM table_204_636 WHERE "season" > '2011-12' ORDER BY "season" LIMIT 1
squall
CREATE TABLE table_204_164 ( id number, "branding" text, "callsign" text, "frequency" text, "power (kw)" text, "location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many stations have at least 5 kw or more listed in the power column ?
SELECT COUNT("branding") FROM table_204_164 WHERE "power (kw)" >= 5
squall
CREATE TABLE table_169766_13 ( new_returning_same_network VARCHAR, show VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the new/returning/same network name for This Week in Baseball?
SELECT new_returning_same_network FROM table_169766_13 WHERE show = "This Week in Baseball"
sql_create_context
CREATE TABLE table_name_31 ( name VARCHAR, province VARCHAR, appointed VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was appointed on October 21, 2011 from Quebec?
SELECT name FROM table_name_31 WHERE province = "quebec" AND appointed = "october 21, 2011"
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 diagnoses.icd9_code, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "7273"
mimicsql_data
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(gwyjzb.IN_DIAG_DIS_CD) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '63660143' AND gwyjzb.IN_HOSP_DATE BETWEEN '2007-07-21' AND '2010-12-24' UNION SELECT COUNT(fgwyjzb.IN_DIAG_DIS_CD) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '63660143' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2007-07-21' AND '2010-12-24'
css
CREATE TABLE table_45464 ( "Year" real, "Seed" real, "Round" text, "Opponent" text, "Result/Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Round when Year is 1987?
SELECT "Round" FROM table_45464 WHERE "Year" = '1987'
wikisql
CREATE TABLE table_71336 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the venue when the year is after 2001 for the summer olympics?
SELECT "Venue" FROM table_71336 WHERE "Year" > '2001' AND "Competition" = 'summer olympics'
wikisql
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 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 = 15107)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
mimic_iii
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense...
SELECT Id AS "post_link", CreationDate, Score, ViewCount AS "v", AnswerCount AS "a", CommentCount AS "c", LastActivityDate, Tags FROM Posts WHERE ClosedDate IS NULL AND AnswerCount = 0 AND LastActivityDate > (CURRENT_TIMESTAMP() - 10) ORDER BY LastActivityDate DESC LIMIT 100
sede
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABL...
SELECT DISTINCT course.department, course.name, course.number, program_course.category FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category IN ('PreMajor', 'MDE') AND program_course.course_id = course.course_id AND semester.semester = 'Fal...
advising
CREATE TABLE table_name_74 ( venue VARCHAR, partnerships VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue did the partnership of herschelle gibbs / justin kemp happen?
SELECT venue FROM table_name_74 WHERE partnerships = "herschelle gibbs / justin kemp"
sql_create_context
CREATE TABLE table_1140117_5 ( report VARCHAR, race_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the report for the race name V Ulster Trophy?
SELECT report FROM table_1140117_5 WHERE race_name = "V Ulster Trophy"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '蒋阳飙' AND t_kc22.STA_DATE BETWEEN '2011-10-14' AND '2020-11-19' AND t_kc22.SOC_SRT_DIRE_NM = '利可君片(薄膜衣)'
css
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.insurance = "Private" AND procedures.icd9_code = "4610"
mimicsql_data
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'laxatives - psyllium (metamucil, polycarbophil)' AND DATETIME(treatment.treatmenttime, 'start of year') = DA...
eicu
CREATE TABLE table_29873 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who in...
SELECT "High rebounds" FROM table_29873 WHERE "Location Attendance" = 'Honda Center 15,625'
wikisql
CREATE TABLE table_33946 ( "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the partner facing the opponents florian Mayer & alexander wa...
SELECT "Partner" FROM table_33946 WHERE "Opponents in the final" = 'florian mayer & alexander waske'
wikisql
CREATE TABLE table_25691838_2 ( guest VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the guests in the episode with production code 6021?
SELECT guest FROM table_25691838_2 WHERE production_code = 6021
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 demographic.dob, demographic.language FROM demographic WHERE demographic.name = "James Sloan"
mimicsql_data
CREATE TABLE table_30345 ( "Character" text, "Game" text, "Platform" text, "Status" text, "Mystic Arte" text, "Character Voice" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many mystic arte have hisui (jadeite) hearts 1 as the character?
SELECT COUNT("Mystic Arte") FROM table_30345 WHERE "Character" = 'Hisui (Jadeite) Hearts 1'
wikisql
CREATE TABLE table_name_92 ( team VARCHAR, qual_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team had a qual 2 time of 58.385?
SELECT team FROM table_name_92 WHERE qual_2 = "58.385"
sql_create_context
CREATE TABLE table_5514 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of games for a record of 33-13-3?
SELECT SUM("Game") FROM table_5514 WHERE "Record" = '33-13-3'
wikisql
CREATE TABLE table_62721 ( "Elector" text, "Place of birth" text, "Cardinalatial title" text, "Elevated" text, "Elevator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the elevator with the cardinalatial title of Deacon of SS. Sergio e Bacco...
SELECT "Elevator" FROM table_62721 WHERE "Cardinalatial title" = 'deacon of ss. sergio e bacco'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605' AND patient.hos...
eicu
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Guests ( guest_id INTEGER, ...
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings
nvbench
CREATE TABLE table_72126 ( "Nation" text, "Population (thousands)" real, "Internet subscriptions (2000) (thousands of users)" real, "Internet subscriptions (2008) (thousands of users)" real, "% growth (2000\u20132008)" real, "% Internet users" real ) -- Using valid SQLite, answer the following...
SELECT MAX("% growth (2000\u20132008)") FROM table_72126 WHERE "Nation" = 'Burundi'
wikisql
CREATE TABLE table_2668336_17 ( incumbent VARCHAR, candidates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The candidates Charles Fisher (DR) 65.1% W. Jones (F) 34.9% is for what incumbent?
SELECT incumbent FROM table_2668336_17 WHERE candidates = "Charles Fisher (DR) 65.1% W. Jones (F) 34.9%"
sql_create_context
CREATE TABLE table_43631 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Location, when Round is '1', and when Oppon...
SELECT "Location" FROM table_43631 WHERE "Round" = '1' AND "Opponent" = 'joe slick'
wikisql
CREATE TABLE table_4214 ( "Skip (Club)" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 6 is the w what is the pa...
SELECT "PA" FROM table_4214 WHERE "W" = '6'
wikisql
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 (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '76980404' AND mzjzjlb.JZKSRQ BETWEEN '2001-07-25' AND '2018-06-20') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_...
css
CREATE TABLE table_37453 ( "Team" text, "Driver" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest laps a grid less than 22 with a time of +35.268 has?
SELECT MIN("Laps") FROM table_37453 WHERE "Grid" < '22' AND "Time" = '+35.268'
wikisql
CREATE TABLE table_62362 ( "Week" text, "Date" text, "Home team" text, "Away team" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team in week 1?
SELECT "Home team" FROM table_62362 WHERE "Week" = '1'
wikisql
CREATE TABLE table_38203 ( "Rank" real, "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 leowest number of Bronze medals for Jamaica who ranked less than 4 and had more ...
SELECT MIN("Bronze") FROM table_38203 WHERE "Silver" > '0' AND "Rank" < '4' AND "Nation" = 'jamaica' AND "Total" < '22'
wikisql
CREATE TABLE table_name_73 ( venue VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue has a Result of 3-0?
SELECT venue FROM table_name_73 WHERE result = "3-0"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, dep...
SELECT DISTINCT course.department, course.name, course.number, semester.semester, semester.year, student_record.grade FROM course, semester, student_record WHERE student_record.course_id = course.course_id AND student_record.semester = semester.semester_id AND student_record.student_id = 1
advising
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id numbe...
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 = 13782) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item...
mimic_iii
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
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 WHERE course.name L...
advising
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_NM, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '5349528' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_NM
css
CREATE TABLE table_25503 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How ma...
SELECT COUNT("Location Attendance") FROM table_25503 WHERE "Date" = 'December 2'
wikisql
CREATE TABLE table_15197 ( "Name" text, "Hair Color:" text, "Eye Color:" text, "Release Date" text, "Retired?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release date for gold hair color?
SELECT "Release Date" FROM table_15197 WHERE "Hair Color:" = 'gold'
wikisql
CREATE TABLE table_44076 ( "Season" text, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Pos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the f/laps...
SELECT "F/Laps" FROM table_44076 WHERE "Season" = '2011' AND "Races" = '18'
wikisql
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_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral DESC
nvbench
CREATE TABLE table_53312 ( "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. -- Name the report with cuban race
SELECT "Report" FROM table_53312 WHERE "Name" = 'cuban race'
wikisql
CREATE TABLE table_19998428_3 ( san_javier_municipality___percentage_ VARCHAR, cuatro_cañadas_municipality___percentage_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the San Javier municipality percentage if the Cuatro Ca adas municipality percenta...
SELECT san_javier_municipality___percentage_ FROM table_19998428_3 WHERE cuatro_cañadas_municipality___percentage_ = "202"
sql_create_context
CREATE TABLE table_name_48 ( car VARCHAR, yards VARCHAR, avg VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many carries for the player with under 6 yards and an average of over 5?
SELECT COUNT(car) FROM table_name_48 WHERE yards < 6 AND avg > 5
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'malignancy - primary lung cancer' AND STRFTIME('%y', diagnosis.diagnosist...
eicu
CREATE TABLE table_1206114_2 ( implementation VARCHAR, netflow_version VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the implementation when the netflow version is v5, v8, v9, ipfix?
SELECT implementation FROM table_1206114_2 WHERE netflow_version = "v5, v8, v9, IPFIX"
sql_create_context
CREATE TABLE table_17253 ( "Station Number" text, "District" text, "Location" text, "Type" text, "Appliances" text, "Registrations" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are all the type where location is st ives, cambridgeshire
SELECT "Type" FROM table_17253 WHERE "Location" = 'St Ives, Cambridgeshire'
wikisql
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show ...
SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director ORDER BY COUNT(*)
nvbench
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.admityear < "2146" AND procedures.long_title = "Repair of fistula involving bladder and intestine"
mimicsql_data
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2806498' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '28064...
css
CREATE TABLE table_11621915_1 ( winner VARCHAR, purse__$__ VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the winner with purse( $ ) value of bigger than 964017.2297960471 and date value of may 28
SELECT winner FROM table_11621915_1 WHERE purse__$__ > 964017.2297960471 AND date = "May 28"
sql_create_context
CREATE TABLE table_name_28 ( height_ft___m VARCHAR, year VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the height that has a year after 1983 and is named Phoenix Tower?
SELECT height_ft___m FROM table_name_28 WHERE year > 1983 AND name = "phoenix tower"
sql_create_context
CREATE TABLE table_20738 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the away team playing at Carlton?
SELECT "Away team" FROM table_20738 WHERE "Home team" = 'Carlton'
wikisql
CREATE TABLE table_name_96 ( opponent VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent at the game that had a loss of Bell (6 9)?
SELECT opponent FROM table_name_96 WHERE loss = "bell (6–9)"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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 ...
SELECT COUNT(t_kc21.MED_SER_ORG_NO) FROM t_kc21 WHERE t_kc21.PERSON_NM = '李采萱' AND t_kc21.IN_HOSP_DATE BETWEEN '2017-12-31' AND '2018-06-13'
css
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 AVG(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "STERNAL WOUND INFECTION"
mimicsql_data
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT Id, DisplayName, Views AS Age, Reputation FROM Users WHERE Age < 18 AND Reputation >= 200 ORDER BY Age
sede
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2892777' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 22
css
CREATE TABLE table_name_17 ( round VARCHAR, date VARCHAR, venue VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the round of the match at venue A with a result of 1-2 on 7 December 2004?
SELECT round FROM table_name_17 WHERE venue = "a" AND result = "1-2" AND date = "7 december 2004"
sql_create_context
CREATE TABLE table_name_2 ( film_or_series VARCHAR, result VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which film or series was nominated in the category of best fansite?
SELECT film_or_series FROM table_name_2 WHERE result = "nominated" AND category = "best fansite"
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instruc...
SELECT DISTINCT course.department, course.name, course.number FROM program_course INNER JOIN course ON program_course.course_id = course.course_id WHERE course.department = 'CAAS'
advising
CREATE TABLE table_72208 ( "Series #" real, "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. -- What is the original air dates for t...
SELECT "Original air date" FROM table_72208 WHERE "Title" = 'Firestorm'
wikisql
CREATE TABLE table_8928 ( "Year" real, "Date" text, "Winner" text, "Result" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Winner, when Location is Connie Mack Stadium, and when Year is 1946?
SELECT "Winner" FROM table_8928 WHERE "Location" = 'connie mack stadium' AND "Year" = '1946'
wikisql
CREATE TABLE table_30745 ( "IOC Code" text, "Country" text, "Network Station" text, "Television Station" text, "Radio Station" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many television station listing have a radio station as lao national ra...
SELECT COUNT("Television Station") FROM table_30745 WHERE "Radio Station" = 'Lao National Radio'
wikisql
CREATE TABLE table_name_75 ( tournament VARCHAR, surface VARCHAR, finalist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the tournament where the match was on a hard surface and jan-michael gambill (19) was the finalist?
SELECT tournament FROM table_name_75 WHERE surface = "hard" AND finalist = "jan-michael gambill (19)"
sql_create_context
CREATE TABLE table_2171 ( "English Name" text, "Simplified Chinese" text, "Traditional Chinese" text, "Pinyin" text, "Area" real, "Population" real, "Density" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of areas t...
SELECT COUNT("Area") FROM table_2171 WHERE "English Name" = 'Nanqiao District'
wikisql
CREATE TABLE table_25030512_12 ( candidates VARCHAR, district VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 2010 is the first elected and Florida 7 is the district who are the candidates?
SELECT candidates FROM table_25030512_12 WHERE district = "Florida 7" AND first_elected = "2010"
sql_create_context
CREATE TABLE table_204_392 ( id number, "#" number, "stadium" text, "capacity" number, "city" text, "country" text, "domed or retractable roof" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which is the only stadium on the list that is in k...
SELECT "stadium" FROM table_204_392 WHERE "country" = 'kazakhstan'
squall
CREATE TABLE table_name_82 ( year INTEGER, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest year for the title, 'loves lost and found'?
SELECT MAX(year) FROM table_name_82 WHERE title = "loves lost and found"
sql_create_context
CREATE TABLE table_name_93 ( club VARCHAR, played VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club has a played number of 19, and the lost of 14?
SELECT club FROM table_name_93 WHERE played = "19" AND lost = "14"
sql_create_context
CREATE TABLE table_40788 ( "Abbr." text, "Political Leader" text, "International Affiliation" text, "Votes ( 2012 )" text, "House of Rep. seats" real, "Senate seats" real, "European Parliament seats" real ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT AVG("House of Rep. seats") FROM table_40788 WHERE "Abbr." = 'd66'
wikisql
CREATE TABLE table_name_48 ( average INTEGER, evening_gown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest average score where the evening gown score was 8.811?
SELECT MIN(average) FROM table_name_48 WHERE evening_gown = 8.811
sql_create_context
CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier ORDER BY COUNT(*)
nvbench
CREATE TABLE table_17571 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How in prothrombin affected by glanzmann's thrombasthenia...
SELECT "Prothrombin time" FROM table_17571 WHERE "Condition" = 'Glanzmann''s thrombasthenia'
wikisql
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREA...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO...
atis
CREATE TABLE table_4038 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different college/junior/club teams had player John ...
SELECT COUNT("College/junior/club team") FROM table_4038 WHERE "Player" = 'John Dzikowski'
wikisql
CREATE TABLE dorm ( gender VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of distinct gender for dorms.
SELECT COUNT(DISTINCT gender) FROM dorm
sql_create_context
CREATE TABLE table_2467 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which week is the theme n/a
SELECT "Week #" FROM table_2467 WHERE "Theme" = 'N/A'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
SELECT MIN(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-21388')) AND NOT vitalperiodic.respiration IS ...
eicu
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 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.PERSON_NM = '何欣欣' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_38541 ( "Station Code" text, "Station" text, "Arrival" text, "Departure" text, "Kilometers" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is listede for Departure that also has a Station Code of CLT?
SELECT "Departure" FROM table_38541 WHERE "Station Code" = 'clt'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
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 = '006-124193')) AND STRFTIME('%y-%m', lab.labresulttime) = '2105-12'
eicu
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 ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road
nvbench
CREATE TABLE table_13487 ( "Date" text, "Japan" text, "Americas" text, "Other" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the sales in Japan for the release totaling 1.82 million?
SELECT "Japan" FROM table_13487 WHERE "Total" = '1.82 million'
wikisql
CREATE TABLE table_45539 ( "Season" real, "Premiere" text, "Finale" text, "Rank" text, "Rating" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the premiere that had a 20.9 rating?
SELECT "Premiere" FROM table_45539 WHERE "Rating" = '20.9'
wikisql
CREATE TABLE film ( Director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the distinct director of all films.
SELECT DISTINCT Director FROM film
sql_create_context
CREATE TABLE table_26242 ( "Episode Title" text, "Song(s) Title" text, "Writer" text, "Singer(s)" text, "Album(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What album was the song Shimmy Jimmy from the episode titled Toy to the world on?
SELECT "Album(s)" FROM table_26242 WHERE "Episode Title" = 'Toy to the World' AND "Song(s) Title" = 'Shimmy Jimmy'
wikisql
CREATE TABLE table_15081 ( "category" text, "1999" text, "2000" text, "2001" text, "2004" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What car was awarded sub 1 litre in 2000?
SELECT "2000" FROM table_15081 WHERE "category" = 'sub 1 litre'
wikisql
CREATE TABLE table_name_41 ( circuit VARCHAR, winning_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What circuit saw Cabin Racing as the winning team?
SELECT circuit FROM table_name_41 WHERE winning_team = "cabin racing"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.ethnicity = "BLACK/CAPE VERDEAN"
mimicsql_data
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 vitalperiodic ( vitalperiodicid number, ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-10...
eicu
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT (SELECT COUNT(*) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '80429036' AND wdmzjzjlb.JZKSRQ BETWEEN '2001-09-04' AND '2005-11-28' UNION SELECT COUNT(*) FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjl...
css
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '范慧捷' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-01-20' AND '2013-03-08'
css
CREATE TABLE table_27715173_10 ( score VARCHAR, high_rebounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the team score when Tim Duncan (12) got the high rebounds?
SELECT score FROM table_27715173_10 WHERE high_rebounds = "Tim Duncan (12)"
sql_create_context