instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_203_36 ( id number, "parish" text, "locality" text, "parish priest" text, "founded" number, "closed" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- other than st mary , which parish was founded by fr frank thorpe ?
SELECT "parish" FROM table_203_36 WHERE "parish" <> 'st mary' AND "parish priest" = 'fr frank thorpe'
squall
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 (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-64535' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE table_54208 ( "Player" text, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Utah Jazz guard, played at BYU?
SELECT "Player" FROM table_54208 WHERE "Position" = 'guard' AND "School/Club Team" = 'byu'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, countr...
SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Nutrition%' AND NOT instructor.name LIKE '%Pifer%' AND offering_instructor.instructor_id = instructor.ins...
advising
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 HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE table_42324 ( "Team" text, "Match" real, "Points" real, "Draw" real, "Lost" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many matches ended with more than 22 points?
SELECT SUM("Match") FROM table_42324 WHERE "Points" > '22'
wikisql
CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), t...
SELECT title, SUM(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY title DESC
nvbench
CREATE TABLE table_14835674_1 ( introductory_phrase VARCHAR, original_airdate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the inroductory phase for the episode that originally aired january 21?
SELECT introductory_phrase FROM table_14835674_1 WHERE original_airdate = "January 21"
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 demographic.diagnosis, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "24425"
mimicsql_data
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE EM...
SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_NAME) FROM DEPARTMENT
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.gender = "F"
mimicsql_data
CREATE TABLE table_203_683 ( id number, "season" text, "league" text, "gold" text, "silver" text, "bronze" text, "winning manager" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- no team has more cup wins than this team ?
SELECT "gold" FROM table_203_683 GROUP BY "gold" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_29282 ( "Position" real, "Building" text, "City" text, "Height" text, "Number of floors" real, "Completion" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the building is Costanera Center Torre 1, what is the height?
SELECT "Height" FROM table_29282 WHERE "Building" = 'Costanera Center Torre 1'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(School_ID) DESC
nvbench
CREATE TABLE table_name_4 ( bronze VARCHAR, total VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bronze medals did the team have with 0 total silver and less than 3 total medals?
SELECT bronze FROM table_name_4 WHERE total < 3 AND silver > 0
sql_create_context
CREATE TABLE table_16060 ( "Round" real, "Choice" real, "Overall" real, "Player name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Overall pick 240 was a pick in which round?
SELECT "Round" FROM table_16060 WHERE "Overall" = '240'
wikisql
CREATE TABLE table_203_153 ( id number, "stamp issue date" text, "stamp set" text, "#cards" text, "card set ref" text, "qty. issued" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which stamp set had the greatest quantity issued ?
SELECT "stamp set" FROM table_203_153 ORDER BY "qty. issued" DESC LIMIT 1
squall
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 T1.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code
nvbench
CREATE TABLE table_64332 ( "Year" real, "1st Place Team" text, "2nd Place Team" text, "3rd Place Team" text, "4th Place Team" text, "Host Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What location hosted when Wells Motors, Greeley, C...
SELECT "Host Location" FROM table_64332 WHERE "4th Place Team" = 'wells motors, greeley, co'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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 WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.admityear < "2103"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.days_stay > "20"
mimicsql_data
CREATE TABLE table_1242 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the regular season from year 2012?
SELECT "Regular Season" FROM table_1242 WHERE "Year" = '2012'
wikisql
CREATE TABLE table_42336 ( "State / Territory" text, "Building" text, "Height" text, "Floor count" real, "Completed" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What state/territory has lovett tower as the building?
SELECT "State / Territory" FROM table_42336 WHERE "Building" = 'lovett tower'
wikisql
CREATE TABLE table_67522 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the driver when there were 35 laps?
SELECT "Driver" FROM table_67522 WHERE "Laps" = '35'
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.expire_flag = "1" AND demographic.diagnosis = "CHEST PAIN"
mimicsql_data
CREATE TABLE table_9563 ( "Name" text, "Mi from Kingston" real, "Km from Kingston" real, "Parish" text, "Length feet" real, "Length meters" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Lenth Feet, when Mi From Kingston is greater than ...
SELECT "Length feet" FROM table_9563 WHERE "Mi from Kingston" > '84.5' AND "Length meters" > '55.5' AND "Name" = 'unnamed'
wikisql
CREATE TABLE table_name_69 ( second_quarter VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a rank of 2 what is the second quarter?
SELECT second_quarter FROM table_name_69 WHERE rank = 2
sql_create_context
CREATE TABLE table_name_22 ( nation VARCHAR, places VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Nation Placed 122.5?
SELECT nation FROM table_name_22 WHERE places = 122.5
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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.insurance = "Private"
mimicsql_data
CREATE TABLE table_69415 ( "Format" text, "Filename extension" text, "Image support" text, "Interactivity support" text, "Word wrap support" text, "Open standard" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Filename extension has an Int...
SELECT "Filename extension" FROM table_69415 WHERE "Interactivity support" = 'no' AND "Open standard" = 'yes' AND "Image support" = 'no'
wikisql
CREATE TABLE table_name_37 ( player VARCHAR, pick VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a Pick larger than 2, and a Position of forward?
SELECT player FROM table_name_37 WHERE pick > 2 AND position = "forward"
sql_create_context
CREATE TABLE table_75822 ( "Player" text, "FG Pct" real, "3FGA" real, "3FGM" real, "3FG Pct" real, "FT Pct" real, "Off Reb" real, "Def Reb" real, "Total Reb" real, "Asst" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the...
SELECT COUNT("Off Reb") FROM table_75822 WHERE "Total Reb" < '65' AND "Def Reb" = '5' AND "Asst" < '7'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Ureteral catheterization"
mimicsql_data
CREATE TABLE table_name_4 ( score VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the score when the Wolverhampton Wanderers played at home?
SELECT score FROM table_name_4 WHERE home_team = "wolverhampton wanderers"
sql_create_context
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.itemid = "50803"
mimicsql_data
CREATE TABLE table_200_14 ( id number, "act" text, "year signed" number, "# albums released under bad boy" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year did machine gun kelly sign with bad boy records ?
SELECT "year signed" FROM table_200_14 WHERE "act" = 'machine gun kelly'
squall
CREATE TABLE table_69995 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Score with the Visitor of Montreal Maroons and has a Date of December 28?
SELECT "Score" FROM table_69995 WHERE "Visitor" = 'montreal maroons' AND "Date" = 'december 28'
wikisql
CREATE TABLE table_name_64 ( country VARCHAR, place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Country, when Place is 'T4', and when Player is 'Scott Simpson'?
SELECT country FROM table_name_64 WHERE place = "t4" AND player = "scott simpson"
sql_create_context
CREATE TABLE table_11890 ( "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. -- What is the size of the biggest crowd for a game...
SELECT MAX("Crowd") FROM table_11890 WHERE "Away team" = 'fitzroy'
wikisql
CREATE TABLE table_2886617_9 ( college_junior_club_team VARCHAR, nhl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college club team did the Dallas Stars choose their draft pick from?
SELECT college_junior_club_team FROM table_2886617_9 WHERE nhl_team = "Dallas Stars"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text,...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-13127')) AND intakeoutput.cellpath LIKE '%output%...
eicu
CREATE TABLE table_40075 ( "Ring name" text, "Current rank" text, "Debut" text, "Stable" text, "Birthplace" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Ring Name, when Stable is Kasugano, and when Birthplace is Z Mtskheta , Georgia?
SELECT "Ring name" FROM table_40075 WHERE "Stable" = 'kasugano' AND "Birthplace" = 'z mtskheta , georgia'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'oxygen therapy (> 60%)' AND STRFTIME('%y', treatment.treatmenttime) = '21...
eicu
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 DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'bedside glucose' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '032-9900' AND NO...
eicu
CREATE TABLE table_45244 ( "Season" real, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Position ...
SELECT "Position" FROM table_45244 WHERE "Team" = 'sahara force india f1 team' AND "Points" = '46'
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 tr...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 22756
mimic_iii
CREATE TABLE table_39819 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Leading Scorer is Tyrone Hill , 20 Point...
SELECT "Score" FROM table_39819 WHERE "Leading scorer" = 'tyrone hill , 20 points'
wikisql
CREATE TABLE table_204_603 ( id number, "pos" text, "no" number, "rider" text, "bike" text, "laps" number, "time" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many points did jonas folger score ?...
SELECT "points" FROM table_204_603 WHERE "rider" = 'jonas folger'
squall
CREATE TABLE table_30067 ( "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("High assists") FROM table_30067 WHERE "Location Attendance" = 'Seattle Center Coliseum 14,180'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "MAGS1I" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_name_12 ( dynamo INTEGER, draw VARCHAR, spartak VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the least dynamo when spartak is more than 9, competition is totals and draw is more than 24?
SELECT MIN(dynamo) FROM table_name_12 WHERE spartak > 9 AND competition = "totals" AND draw > 24
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 gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '18467147' AND gwyjzb.IN_HOSP_DATE BETWEEN '2005-03-16' AND '2014-05-31' GROUP BY gwyjzb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID...
css
CREATE TABLE table_name_53 ( bronze INTEGER, gold INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the bronze number for the nation with less than 0 gold?
SELECT MIN(bronze) FROM table_name_53 WHERE gold < 0
sql_create_context
CREATE TABLE table_1939202_2 ( year VARCHAR, us_open_cup VARCHAR, league VARCHAR, playoffs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year at the US Open Cup quarterfinals, were the playoffs in the semifinals for the USL second division?
SELECT year FROM table_1939202_2 WHERE league = "USL Second division" AND playoffs = "Semifinals" AND us_open_cup = "Quarterfinals"
sql_create_context
CREATE TABLE guests ( guest_id number, gender_code text, guest_first_name text, guest_last_name text, date_of_birth time ) CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_date time, available_yn others ) CREATE TABLE apartments ( apt_id number, ...
SELECT SUM(T2.room_count) FROM apartment_facilities AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = "Gym"
spider
CREATE TABLE table_name_64 ( celebrity VARCHAR, exited VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who exited on Day 12?
SELECT celebrity FROM table_name_64 WHERE exited = "day 12"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '90180222' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2021-06-07')
css
CREATE TABLE table_25955 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times was there a record of 49-15-11?...
SELECT COUNT("Attendance") FROM table_25955 WHERE "Record" = '49-15-11'
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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT has_projects FROM course WHERE department = 'EECS' AND number = 381
advising
CREATE TABLE zyb ( 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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '75549243' AND qtb.IN_HOSP_DATE BETWEEN '2000-06-05' AND '2019-12-01' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_k...
css
CREATE TABLE table_18646 ( "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. -- When was incumbent Leo E. Allen first elected?
SELECT MIN("First elected") FROM table_18646 WHERE "Incumbent" = 'Leo E. Allen'
wikisql
CREATE TABLE table_37888 ( "Auction House" text, "Year" real, "Event" text, "Price" real, "GBP Price" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average GBP Price with an event in Monterey, a RM auction house, and a price of $154,000...
SELECT AVG("GBP Price") FROM table_37888 WHERE "Event" = 'monterey' AND "Auction House" = 'rm' AND "Price" = '154,000' AND "Year" > '2003'
wikisql
CREATE TABLE table_13232 ( "Rank" real, "Player" text, "Wickets" real, "Average" real, "Career" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the career of the rank higher than 1, with an average less than 36.13 and 15 wickets, and player ...
SELECT "Career" FROM table_13232 WHERE "Rank" > '1' AND "Average" < '36.13' AND "Wickets" = '15' AND "Player" = 'george o''brien'
wikisql
CREATE TABLE table_26638600_3 ( lites_2_race_two_winning_team VARCHAR, lites_1_race_two_winning_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the lites 2 race two winning team when #11 Performance Tech is the lites 1 race two winning team?
SELECT lites_2_race_two_winning_team FROM table_26638600_3 WHERE lites_1_race_two_winning_team = "#11 Performance Tech"
sql_create_context
CREATE TABLE table_name_81 ( gold INTEGER, total INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For countries that won more than 32 gold medals, what was the highest number of golds?
SELECT MAX(gold) FROM table_name_81 WHERE total > 32
sql_create_context
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2031" AND diagnoses.short_title = "Dysphagia NEC"
mimicsql_data
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Transfusion of packed cells"
mimicsql_data
CREATE TABLE table_50382 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average pick with 85 overall in a round lower than 3?
SELECT AVG("Pick") FROM table_50382 WHERE "Overall" = '85' AND "Round" < '3'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT t.TagName, COUNT(*) AS NumAnswers, SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS NumAccepted, (SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) * 100.0 / COUNT(*)) AS AcceptedPercent FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id INNER JOIN PostTags AS pt ON pt.PostId = q.Id...
sede
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( ...
SELECT COUNT(DISTINCT COURSE_PREREQUISITEalias0.course_id), COURSEalias0.department, COURSEalias0.name, COURSEalias0.number FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course AS COURSEalias1, course_offering AS COURSE_OFFERINGali...
advising
CREATE TABLE table_49631 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which road team has a result of 117-114?
SELECT "Road Team" FROM table_49631 WHERE "Result" = '117-114'
wikisql
CREATE TABLE table_58165 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the team with a qual 1 time of 1:17.481?
SELECT "Team" FROM table_58165 WHERE "Qual 1" = '1:17.481'
wikisql
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...
WITH results AS (SELECT (SELECT SUM(ViewCount) FROM Posts WHERE PostTypeId = 1 AND (Posts.Tags LIKE '%dnd%' OR Posts.Tags LIKE '%pathfinder%' OR Posts.Tags LIKE '%dungeons-and-dragons%')) AS DndViews, (SELECT SUM(ViewCount) FROM Posts WHERE PostTypeId = 1) AS TotalViews) SELECT DndViews, TotalViews, (DndViews * 1.0 / T...
sede
CREATE TABLE table_80336 ( "Goal" real, "Date" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date has 3 as the goal?
SELECT "Date" FROM table_80336 WHERE "Goal" = '3'
wikisql
CREATE TABLE table_1341453_40 ( first_elected VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was incumbent Bud Shuster first elected?
SELECT first_elected FROM table_1341453_40 WHERE incumbent = "Bud Shuster"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT COUNT(*) FROM zyjybgb WHERE zyjybgb.YLJGDM = '4874392' AND zyjybgb.BGRQ BETWEEN '2006-01-26' AND '2013-01-28' UNION SELECT COUNT(*) FROM mzjybgb WHERE mzjybgb.YLJGDM = '4874392' AND mzjybgb.BGRQ BETWEEN '2006-01-26' AND '2013-01-28'
css
CREATE TABLE table_66303 ( "Score" text, "Shooter" text, "Date" text, "Comp" text, "Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the date when the score was 690.3?
SELECT "Date" FROM table_66303 WHERE "Score" = '690.3'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayNa...
SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS rank, UserId AS "user_link", COUNT(*) AS badges FROM Badges WHERE Name = 'Necromancer' GROUP BY UserId ORDER BY Badges DESC LIMIT 120
sede
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 OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '范馨逸' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 6053.87)
css
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40), oth...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100 ORDER BY date_of_transaction DESC
nvbench
CREATE TABLE table_2562572_27 ( dominant_religion__2002_ VARCHAR, population__2011_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the dominant religions in the place with a population of 83?
SELECT dominant_religion__2002_ FROM table_2562572_27 WHERE population__2011_ = "83"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, h...
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32168 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime ...
mimic_iii
CREATE TABLE table_20704243_5 ( us_viewers__in_millions_ VARCHAR, series__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of viewers for series number 50
SELECT us_viewers__in_millions_ FROM table_20704243_5 WHERE series__number = 50
sql_create_context
CREATE TABLE table_47539 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Grid of R gis Laconi's bike that is a Kawasaki zx-10r?
SELECT "Grid" FROM table_47539 WHERE "Bike" = 'kawasaki zx-10r' AND "Rider" = 'régis laconi'
wikisql
CREATE TABLE table_36616 ( "Athlete" text, "Event" text, "Quarterfinal" text, "Semifinal" text, "Final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the event result for athlete Ali Ekranpour?
SELECT "Event" FROM table_36616 WHERE "Athlete" = 'ali ekranpour'
wikisql
CREATE TABLE company ( market_value INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show minimum, maximum, and average market value for all companies.
SELECT MIN(market_value), MAX(market_value), AVG(market_value) FROM company
sql_create_context
CREATE TABLE table_name_20 ( prom__m_ VARCHAR, class VARCHAR, height__m_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the prom with Hewitt class and a Height (m) of 715?
SELECT prom__m_ FROM table_name_20 WHERE class = "hewitt" AND height__m_ = 715
sql_create_context
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank
nvbench
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'LATIN' AND course.number = 993 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offe...
advising
CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citi...
SELECT DISTINCT COUNT(cite.citingpaperid) FROM author, cite, keyphrase, paperkeyphrase, writes WHERE author.authorname = 'li dong' AND keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = cite.citedpaperid AND writ...
scholar
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid num...
SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 4
eicu
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 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 = '58973613' AND hz_info.YLJGDM = '3560417' AND NOT mzjzjlb.JZZDSM LIKE '%低钾血症%'
css
CREATE TABLE table_57706 ( "Date" text, "Course" text, "Distance" text, "Type" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of race took place on the course Orta San Giulio to Milan?
SELECT "Type" FROM table_57706 WHERE "Course" = 'orta san giulio to milan'
wikisql
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_nam...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings
nvbench
CREATE TABLE table_14070 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament is played on a carpet surface?
SELECT "Tournament" FROM table_14070 WHERE "Surface" = 'carpet'
wikisql
CREATE TABLE table_63776 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number for the position that has less than 2 draws, less than 9 losses a...
SELECT COUNT("Position") FROM table_63776 WHERE "Drawn" < '2' AND "Lost" < '9' AND "Points" > '24'
wikisql
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar...
SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ENVIRON' AND course.number = 255 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of...
advising
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "Fibrin Degradation Products"
mimicsql_data