instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_11452830_2 ( a_ VARCHAR, kickoff_ VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times was there a kickoff in the September 4, 1988 game?
SELECT COUNT(kickoff_) AS "a_" FROM table_11452830_2 WHERE date = "September 4, 1988"
sql_create_context
CREATE TABLE table_24779 ( "Year (Ceremony)" text, "English title" text, "Spanish title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many english titles were directed by carlos moreno?
SELECT COUNT("English title") FROM table_24779 WHERE "Director" = 'Carlos Moreno'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TI...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_name_19 ( laps VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of laps completed by the car in grid 10?
SELECT laps FROM table_name_19 WHERE grid = "10"
sql_create_context
CREATE TABLE table_15541 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the catalog number of Alfa records?
SELECT "Catalog" FROM table_15541 WHERE "Label" = 'alfa records'
wikisql
CREATE TABLE table_name_65 ( ground VARCHAR, match VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was match 8 played?
SELECT ground FROM table_name_65 WHERE match = 8
sql_create_context
CREATE TABLE table_name_12 ( money___ INTEGER, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the monetary sum with a score of 75-71-75-72=293?
SELECT SUM(money___) AS $__ FROM table_name_12 WHERE score = 75 - 71 - 75 - 72 = 293
sql_create_context
CREATE TABLE table_33522 ( "Name" text, "Area" real, "Inhabitants" real, "People per km\u00b2" real, "Main places" text, "Regions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of people per km2 for the sandoy region with an are...
SELECT SUM("People per km\u00b2") FROM table_33522 WHERE "Regions" = 'sandoy' AND "Area" = '112.1'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '9742956' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_IN_DIAG_DIS_CD
css
CREATE TABLE table_32142 ( "Conference" text, "# of Bids" real, "Record" text, "Win %" text, "Round of 32" text, "Sweet Sixteen" text, "Elite Eight" text, "Final Four" text, "Championship Game" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "Round of 32" FROM table_32142 WHERE "Conference" = 'southland'
wikisql
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '52953159' AND t_kc21.MED_SER_ORG_NO = '3607978' AND t_kc21.IN_HOSP_DATE BETWEEN '2015-08-12' AND '2015-10-01')
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4269)) AND DATETIME(inputevents_cv.c...
mimic_iii
CREATE TABLE table_name_2 ( top_25 INTEGER, wins INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Top-25 with Wins less than 0?
SELECT MIN(top_25) FROM table_name_2 WHERE wins < 0
sql_create_context
CREATE TABLE table_1741 ( "Season" real, "Winners" text, "Total wins" real, "Runners-up" text, "Third-place" text, "fourth-placed" text, "Number of clubs" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was placed fourth when third was Be...
SELECT "fourth-placed" FROM table_1741 WHERE "Third-place" = 'Beijing Guoan' AND "Winners" = 'Dalian Wanda' AND "Total wins" = '4'
wikisql
CREATE TABLE table_name_28 ( title VARCHAR, leading_lady VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which title had Muriel Evans as leading lady?
SELECT title FROM table_name_28 WHERE leading_lady = "muriel evans"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int,...
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'MKT' AND course.number = 303 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.of...
advising
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.long_title = "Open and other right hemicolectomy"
mimicsql_data
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, 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, JY...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz...
css
CREATE TABLE table_12284476_8 ( series VARCHAR, reverse VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the series with reverse being swimming
SELECT series FROM table_12284476_8 WHERE reverse = "Swimming"
sql_create_context
CREATE TABLE table_1140074_2 ( race VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the race winner with location being jacarepagu
SELECT race AS Winner FROM table_1140074_2 WHERE location = "Jacarepaguá"
sql_create_context
CREATE TABLE table_76764 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Competition had a Score of 2 0?
SELECT "Competition" FROM table_76764 WHERE "Score" = '2–0'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_63661 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Attendance of the game with a Score of 0 0?
SELECT "Attendance" FROM table_63661 WHERE "Score" = '0 – 0'
wikisql
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 AVG(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 = '031-11804')) AND NOT vitalperiodic.sao2 IS NULL AND DATET...
eicu
CREATE TABLE table_name_46 ( rounds VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds did shirley van der lof go?
SELECT rounds FROM table_name_46 WHERE driver = "shirley van der lof"
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS"
mimicsql_data
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN program_course WHERE ((course.number < 400 + 100 AND course.number >= 400) OR (course.number < 500 + 100 AND course.number >= 500)) AND course.department = 'MFG' AND program_course.workload = (SELECT MIN(PROGRA...
advising
CREATE TABLE table_name_27 ( round INTEGER, pole_position VARCHAR, fastest_lap VARCHAR, winning_driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lowest round for when pole position and winning driver is michael schumacher
SELECT MIN(round) FROM table_name_27 WHERE fastest_lap = "michael schumacher" AND winning_driver = "michael schumacher" AND pole_position = "michael schumacher"
sql_create_context
CREATE TABLE table_name_25 ( year INTEGER, power VARCHAR, trim VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Year Average that has a Power of BHP (KW) and Trim of LS/2LT?
SELECT AVG(year) FROM table_name_25 WHERE power = "bhp (kw)" AND trim = "ls/2lt"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH ...
css
CREATE TABLE table_203_379 ( id number, "first issued" text, "design" text, "slogan" text, "serial format" text, "serials issued" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was the first baseplate issued ?
SELECT "first issued" FROM table_203_379 ORDER BY "first issued" LIMIT 1
squall
CREATE TABLE table_77666 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the higest attendance on November 9, 1958?
SELECT MAX("Attendance") FROM table_77666 WHERE "Date" = 'november 9, 1958'
wikisql
CREATE TABLE table_37495 ( "Date" real, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has an Opponent in the final of mehdi tahiri?
SELECT "Score" FROM table_37495 WHERE "Opponent in the final" = 'mehdi tahiri'
wikisql
CREATE TABLE table_name_33 ( grid INTEGER, time VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest grid with time of +0.499,when laps are larger than 21?
SELECT MIN(grid) FROM table_name_33 WHERE time = "+0.499" AND laps > 21
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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "5856"
mimicsql_data
CREATE TABLE table_14853 ( "Title" text, "Bugs , Daffy , or Both?" text, "Year" real, "Director" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the director for 1957
SELECT "Director" FROM table_14853 WHERE "Year" = '1957'
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.dod_year <= "2131.0" AND procedures.short_title = "Other skin & subq i & d"
mimicsql_data
CREATE TABLE table_12533 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game has an Opponent of phoenix suns?
SELECT "Game" FROM table_12533 WHERE "Opponent" = 'phoenix suns'
wikisql
CREATE TABLE table_67587 ( "Season" text, "Prelim" text, "1st round" text, "2nd round" text, "3rd round" text, "Finals" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 3rd round for 1st eound of out of playoffs
SELECT "3rd round" FROM table_67587 WHERE "1st round" = 'out of playoffs'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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.icd9_code = "42613" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p oral surgery procedure' AND STRFTIME...
eicu
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_SEX = '褚子琪' AND MOD(zyb.MED_CLINIC_ID, 1) = 0
css
CREATE TABLE table_60162 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Record has an Opponent of vs washington wizards?
SELECT "Record" FROM table_60162 WHERE "Opponent" = 'vs washington wizards'
wikisql
CREATE TABLE table_name_17 ( crowd VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total crowd size that saw Geelong play as the away team?
SELECT COUNT(crowd) FROM table_name_17 WHERE away_team = "geelong"
sql_create_context
CREATE TABLE table_16944 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the date where location is illinois
SELECT "Date" FROM table_16944 WHERE "Location" = 'Illinois'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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 cos...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( ...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'furosemide 10 mg...
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 MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '蒋华荣' AND IN_HOSP_DATE BETWEEN '2012-09-21' AND '2015-10-15' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_name_32 ( team VARCHAR, manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team does Graeme Souness manage?
SELECT team FROM table_name_32 WHERE manager = "graeme souness"
sql_create_context
CREATE TABLE table_name_77 ( result VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Result, when Venue is G tzis , Austria?
SELECT result FROM table_name_77 WHERE venue = "götzis , austria"
sql_create_context
CREATE TABLE table_name_23 ( launched VARCHAR, commissioned VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the launched for august 31, 1964
SELECT launched FROM table_name_23 WHERE commissioned = "august 31, 1964"
sql_create_context
CREATE TABLE table_24438 ( "State" text, "Governor" text, "Senior U.S. Senator" text, "Junior U.S. Senator" text, "U.S. House Delegation" text, "Upper House Majority" text, "Lower House Majority" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT "Lower House Majority" FROM table_24438 WHERE "Senior U.S. Senator" = 'J. Shaheen'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA" AND demographic.age < "82"
mimicsql_data
CREATE TABLE mzb ( CLINIC_ID 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, INSU_TYPE text, IN...
SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '2465778' AND qtb.IN_HOSP_DATE BETWEEN '2006-06-24' AND '2021-01-30' AND qtb.PERSON_NM LIKE '姜%' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '2465778' AND gyb.IN_HOSP_DATE BETWEEN '2006-06-24' AND '2021-01-30' AND gyb.PERSON_NM LIKE '姜%' UNION SELECT * FROM zyb WHERE ...
css
CREATE TABLE team_franchise ( active VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many team franchises are active, with active value 'Y'?
SELECT COUNT(*) FROM team_franchise WHERE active = 'Y'
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "NG"
mimicsql_data
CREATE TABLE table_name_13 ( location VARCHAR, left VARCHAR, nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game played with a 2013 left and Royals nickname?
SELECT location FROM table_name_13 WHERE left = "2013" AND nickname = "royals"
sql_create_context
CREATE TABLE table_49971 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player when the to par is more than 11 and the score is 71-71-71-79=292?...
SELECT "Player" FROM table_49971 WHERE "To par" > '11' AND "Score" = '71-71-71-79=292'
wikisql
CREATE TABLE table_11484 ( "Track" real, "Title" text, "Translation" text, "Composer" text, "Recorded" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total track that is translated in brussels?
SELECT COUNT("Track") FROM table_11484 WHERE "Translation" = 'brussels'
wikisql
CREATE TABLE Addresses ( Address_ID VARCHAR(100), Line_1 VARCHAR(255), Line_2 VARCHAR(255), City_Town VARCHAR(255), State_County VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Invoice_Items ( Invoice_Item_ID INTEGER, Invoice_ID INTEGER, Order_ID INTEGER, Order_Item_ID I...
SELECT Actual_Delivery_Date, COUNT(Actual_Delivery_Date) FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2154" AND diagnoses.long_title = "Heart valve replaced by other means"
mimicsql_data
CREATE TABLE table_67453 ( "State" text, "Date" text, "Yes vote" text, "No vote" text, "Vote outcome" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many no votes did North Dakota have?
SELECT "No vote" FROM table_67453 WHERE "State" = 'north dakota'
wikisql
CREATE TABLE table_203_354 ( id number, "party" text, "candidate(s)" text, "votes" number, "percentage" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which party received the least votes
SELECT "party" FROM table_203_354 ORDER BY "votes" LIMIT 1
squall
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-27817')) AND DATETIME(treatment.treatmenttime) <= DATETIME(CU...
eicu
CREATE TABLE table_name_88 ( region VARCHAR, catalog VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What region is the ALCA-272 Catalog?
SELECT region FROM table_name_88 WHERE catalog = "alca-272"
sql_create_context
CREATE TABLE table_50162 ( "Format" text, "Country" text, "Label" text, "Catalogue No." text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Country with a MC Format has a ATCO Records Label?
SELECT "Country" FROM table_50162 WHERE "Label" = 'atco records' AND "Format" = 'mc'
wikisql
CREATE TABLE table_203_513 ( id number, "no." number, "date" text, "home team" text, "visiting team" text, "goals" text, "score" text, "result" text, "venue" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what...
SELECT COUNT(DISTINCT "date") FROM table_203_513 WHERE "result" = 'win' AND "venue" = 'helsinki olympic stadium'
squall
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'protein-calorie malnutrition' AND DATETIME(diagnos...
eicu
CREATE TABLE table_602 ( "No" real, "Player" text, "Height" text, "Position" text, "Year born" real, "Current Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players are from energa czarni?
SELECT COUNT("Position") FROM table_602 WHERE "Current Club" = 'Energa Czarni'
wikisql
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 jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '94379213' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE table_name_91 ( attendance INTEGER, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the maximum attendance when Chicago is the visiting team?
SELECT MAX(attendance) FROM table_name_91 WHERE visitor = "chicago"
sql_create_context
CREATE TABLE table_33924 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What city is in the country of Mayotte?
SELECT "City" FROM table_33924 WHERE "Country" = 'mayotte'
wikisql
CREATE TABLE table_3193 ( "Episode #" real, "Production Count" real, "Original Airdate" text, "Prod. Code" text, "Title" text, "Viewing Figures millions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the production code for the episode had...
SELECT "Prod. Code" FROM table_3193 WHERE "Viewing Figures millions" = '5.55'
wikisql
CREATE TABLE table_28281 ( "Rank" real, "Dismissals" real, "Catches" real, "Stumps" real, "Player" text, "Period" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ranktotal number if the Hashan Tillakaratne?
SELECT COUNT("Rank") FROM table_28281 WHERE "Player" = 'Hashan Tillakaratne'
wikisql
CREATE TABLE table_51 ( "Year" real, "Aircraft kilometers" real, "Departures" real, "Flying hours" real, "Passengers" real, "Seat factor" text, "Employees" real, "Profit/loss" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentag...
SELECT "Seat factor" FROM table_51 WHERE "Year" = '2006'
wikisql
CREATE TABLE table_23810 ( "Date of opinion poll" text, "Conductor" text, "Sample size" real, "For" text, "Against" text, "Undecided" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many polls taken on different dates show an undecided percen...
SELECT COUNT("Date of opinion poll") FROM table_23810 WHERE "Undecided" = '25%'
wikisql
CREATE TABLE table_47520 ( "Season" real, "Premiered" text, "Bachelorette" text, "Profile" text, "Winner" text, "Runner(s)-Up" text, "Proposal" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the bachelorette after season 8?
SELECT "Bachelorette" FROM table_47520 WHERE "Season" > '8'
wikisql
CREATE TABLE table_78601 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the greatest Time with a Year of 1991, and Event of 4x100 m relay?
SELECT MAX("Time") FROM table_78601 WHERE "Year" = '1991' AND "Event" = '4x100 m relay'
wikisql
CREATE TABLE table_name_98 ( difference INTEGER, drew INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest difference for the team that had less than 0 draws?
SELECT MAX(difference) FROM table_name_98 WHERE drew < 0
sql_create_context
CREATE TABLE table_35398 ( "Region" text, "Employment ( salaries & wages)" text, "Self employed" text, "Investment income" text, "Working tax credit" text, "State pensions" text, "Occupational pensions" text, "Disability benefits" text, "Other social security benefits" text, "Oth...
SELECT "Investment income" FROM table_35398 WHERE "Region" = 'eastern england'
wikisql
CREATE TABLE table_name_59 ( record VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Cavaliers Record in the game with a Score of 98-99?
SELECT record FROM table_name_59 WHERE score = "98-99"
sql_create_context
CREATE TABLE table_4069 ( "Category" text, "Player" text, "Team" text, "Games played" real, "Totals" text, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the games played when the category is points per game?
SELECT MIN("Games played") FROM table_4069 WHERE "Category" = 'Points per game'
wikisql
CREATE TABLE table_21783 ( "Level" real, "Shuttles" real, "Cumulative Shuttles" real, "Speed (km/h)" text, "Shuttle Time (seconds)" text, "Total level time (s)" text, "Distance (m)" real, "Cumulative Distance (m)" real, "Cumulative Time (min and seconds)" text ) -- Using valid SQLi...
SELECT MIN("Shuttles") FROM table_21783 WHERE "Shuttle Time (seconds)" = '6.55'
wikisql
CREATE TABLE table_2096 ( "Season" text, "Final Venue" text, "Champion" text, "Result" text, "Finalist" text, "MVP" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the champion for the 1998-99 season?
SELECT "Champion" FROM table_2096 WHERE "Season" = '1998-99'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14154 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin') ORDER BY labevents.chartti...
mimic_iii
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutpu...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'bronchodilator - beta-agonist' AND STRFTIME('%y', treatment.treatmenttime) = '2102') AS t1 JOIN (SELECT pati...
eicu
CREATE TABLE Tourist_Attractions ( How_to_Get_There VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show different ways to get to attractions and the number of attractions that can be accessed in the corresponding way.
SELECT How_to_Get_There, COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There
sql_create_context
CREATE TABLE table_name_62 ( fatalities INTEGER, aircraft_type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many fatalities shows for the lockheed l-1049g?
SELECT SUM(fatalities) FROM table_name_62 WHERE aircraft_type = "lockheed l-1049g"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, 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, JY...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '2106089' AND jybgb.BGRQ BETWEEN '2004-09-06' AND '2012-02-08' GROUP BY jybgb.KSBM HAVING COUNT(*) > 24 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb ...
css
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_...
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 = 'LAS VEGAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN ...
atis
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40)...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) DESC
nvbench
CREATE TABLE table_17117 ( "Year" real, "B\u00f6tzow" text, "Schwante" text, "Vehlefanz" text, "Neu-Vehlefanz" real, "Marwitz" text, "B\u00e4renklau" text, "Eichst\u00e4dt" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the numb...
SELECT "B\u00f6tzow" FROM table_17117 WHERE "Vehlefanz" = '1.800'
wikisql
CREATE TABLE table_name_16 ( premier_league VARCHAR, position VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the premier league number when the position is forward, and the total is more than 22?
SELECT COUNT(premier_league) FROM table_name_16 WHERE position = "forward" AND total > 22
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '68061275' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-10-02' AND '2005-07-28' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_3707 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Title is the total...
SELECT COUNT("Title") FROM table_3707 WHERE "U.S. viewers (million)" = '7.56'
wikisql
CREATE TABLE table_name_43 ( island VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which island is in the United Kingdom?
SELECT island FROM table_name_43 WHERE country = "united kingdom"
sql_create_context
CREATE TABLE table_name_38 ( date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the score 92-134?
SELECT date FROM table_name_38 WHERE score = "92-134"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND diagnosis.diagnosisname = 'svt - multifocal atri...
eicu
CREATE TABLE table_17327264_3 ( date_of_appointment VARCHAR, replaced_by VARCHAR, manner_of_departure VARCHAR, position_in_table VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date of appointment for sacked and 14th position replaced by marc...
SELECT date_of_appointment FROM table_17327264_3 WHERE manner_of_departure = "Sacked" AND position_in_table = "14th" AND replaced_by = "Marco Kostmann"
sql_create_context
CREATE TABLE table_name_29 ( tennis VARCHAR, school_year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Tennis, when School Year is 2004-05?
SELECT tennis FROM table_name_29 WHERE school_year = "2004-05"
sql_create_context