instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE constructors ( constructorId INTEGER, constructorRef TEXT, name TEXT, nationality TEXT, url TEXT ) CREATE TABLE results ( resultId INTEGER, raceId INTEGER, driverId INTEGER, constructorId INTEGER, number INTEGER, grid INTEGER, position TEXT, positionText...
SELECT year, COUNT(year) FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1.year > 2014 GROUP BY year ORDER BY COUNT(year)
nvbench
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType
nvbench
CREATE TABLE table_7851 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For which tournament was Anthony Wall the runner-up?
SELECT "Tournament" FROM table_7851 WHERE "Runner(s)-up" = 'anthony wall'
wikisql
CREATE TABLE table_name_70 ( week INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the average week for result of l 34 24
SELECT AVG(week) FROM table_name_70 WHERE result = "l 34–24"
sql_create_context
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 comment_instructor ( instructor_id int, student_id int, score int, ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%James Lepkowski%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o...
advising
CREATE TABLE table_47093 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Average 1" real, "Points 2" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the P...
SELECT AVG("Points 2") FROM table_47093 WHERE "Played" > '46'
wikisql
CREATE TABLE table_16732659_2 ( rnd INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- FOR AUGUST 13 WHAT IS THE RND ?
SELECT MAX(rnd) FROM table_16732659_2 WHERE date = "August 13"
sql_create_context
CREATE TABLE table_4394 ( "Coach" text, "Years" text, "Win\u2013Loss" text, "Win %" real, "Conference Titles" real, "NCAA Tourn. Appearances" text, "NCAA Titles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which NCAA Tournament Appearance...
SELECT "NCAA Tourn. Appearances" FROM table_4394 WHERE "Conference Titles" > '0' AND "NCAA Titles" = '0' AND "Coach" = 'lou watson'
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_kc22.USE_FRE, t_kc22.EACH_DOSAGE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '32779838394' AND t_kc22.SOC_SRT_DIRE_NM = '吸入用乙酰半胱氨酸溶'
css
CREATE TABLE table_28557 ( "Film Festival" text, "Date of ceremony" text, "Category" text, "Participants/Recipients" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Film Festival had participants/recipients of Isao Tomita?
SELECT "Film Festival" FROM table_28557 WHERE "Participants/Recipients" = 'Isao Tomita'
wikisql
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 WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dob_year < "2101"
mimicsql_data
CREATE TABLE table_name_13 ( pick INTEGER, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest pick number for players from king's (ny)?
SELECT MIN(pick) FROM table_name_13 WHERE college = "king's (ny)"
sql_create_context
CREATE TABLE table_16028499_2 ( game_site VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game site on October 29, 1989?
SELECT game_site FROM table_16028499_2 WHERE date = "October 29, 1989"
sql_create_context
CREATE TABLE table_17857 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the follo...
SELECT COUNT("Tries for") FROM table_17857 WHERE "Tries against" = '45' AND "Losing bonus" = '4'
wikisql
CREATE TABLE table_name_88 ( year VARCHAR, developer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year was the game developed by Music Comp in?
SELECT year FROM table_name_88 WHERE developer = "music comp"
sql_create_context
CREATE TABLE table_name_21 ( draw VARCHAR, goal_diff VARCHAR, loss VARCHAR, point VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total draws were there with a less than 8 loss, more than 30 points, and a goal diff larger than 26?
SELECT COUNT(draw) FROM table_name_21 WHERE loss < 8 AND point > 30 AND goal_diff > 26
sql_create_context
CREATE TABLE table_train_236 ( "id" int, "renal_disease" bool, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "hba1c" float, "fbg" int, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- estimated glom...
SELECT * FROM table_train_236 WHERE estimated_glomerular_filtration_rate_egfr < 45
criteria2sql
CREATE TABLE table_13461 ( "Season" text, "Winner" text, "Score" text, "Runners\u2013up" text, "Venue(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is listed as the Runners-up that also has a Winner of Hajduk Split (3)?
SELECT "Runners\u2013up" FROM table_13461 WHERE "Winner" = 'hajduk split (3)'
wikisql
CREATE TABLE table_name_91 ( premiere_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2nd runner-up for july 20, 2007
SELECT 2 AS nd_runner_up FROM table_name_91 WHERE premiere_date = "july 20, 2007"
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND prescriptions.drug = "Clotrimazole"
mimicsql_data
CREATE TABLE table_70526 ( "Name" text, "Country" text, "Status" text, "Transfer window" text, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has a Transfer fee of , and a Transfer window of summer, and the Status of loan...
SELECT "Country" FROM table_70526 WHERE "Transfer fee" = '—' AND "Transfer window" = 'summer' AND "Status" = 'loaned out' AND "Name" = 'gonzález'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Hemoglobin"
mimicsql_data
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE ...
SELECT DISTINCT airline_code FROM airline
atis
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TAB...
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 638 OR course.number = 519) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
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 = '030-77189' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
eicu
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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, ...
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '7972448' AND mzjzjlb.JZKSRQ BETWEEN '2011-12-28' AND '2018-02-10' AND mzjzjlb.ZSEBZ > 0
css
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_INV_ITEM_TYPE FROM t_kc22 WHERE MED_CLINIC_ID = '71644479467' AND SOC_SRT_DIRE_CD = '812035653'
css
CREATE TABLE table_name_90 ( ages VARCHAR, capacity VARCHAR, ofsted VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Ages have a Capacity larger than 21, and an Ofsted of 106168?
SELECT ages FROM table_name_90 WHERE capacity > 21 AND ofsted = 106168
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 t_kc21.IN_HOSP_DAYS FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '80300861713'
css
CREATE TABLE table_50127 ( "Opposing Team" text, "Against" real, "Date" text, "Venue" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue had the opposing team Natal?
SELECT "Venue" FROM table_50127 WHERE "Opposing Team" = 'natal'
wikisql
CREATE TABLE table_name_21 ( snatch INTEGER, clean_ VARCHAR, _jerk VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest weight snatched for a lifter who had a clean and jerk less than 185?
SELECT MIN(snatch) FROM table_name_21 WHERE clean_ & _jerk < 185
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, chartt...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2489 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'levofloxacin'
mimic_iii
CREATE TABLE table_11000 ( "1910" real, "1920" real, "1930" real, "1940" real, "1950" real, "1960" real, "1970" real, "1980" real, "1990" real, "2000" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1960 is less than 4,228, 1...
SELECT SUM("1970") FROM table_11000 WHERE "1960" < '4,228' AND "1920" < '106,021,568' AND "1980" > '949'
wikisql
CREATE TABLE program ( name VARCHAR, program_id VARCHAR ) CREATE TABLE broadcast ( program_id VARCHAR, Time_of_day VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the names of programs that are never broadcasted in the morning.
SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = "Morning"
sql_create_context
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int )...
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURS...
advising
CREATE TABLE table_name_59 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score on october 14
SELECT score FROM table_name_59 WHERE date = "october 14"
sql_create_context
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 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 = '002-4486')) AND intakeoutput.cellpath LIKE '%intake%'...
eicu
CREATE TABLE table_204_721 ( id number, "rank" number, "wrestler" text, "no. of reigns" number, "combined\ndefenses" number, "combined\ndays" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many days combined did kevin steen had
SELECT "combined\ndays" FROM table_204_721 WHERE "wrestler" = 'kevin steen'
squall
CREATE TABLE table_72393 ( "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. -- Name the number of first elected for phil crane
SELECT COUNT("First elected") FROM table_72393 WHERE "Incumbent" = 'Phil Crane'
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_Regular_Season, School_ID FROM basketball_match ORDER BY School_ID
nvbench
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT P.* FROM (SELECT Id FROM Users ORDER BY Reputation DESC LIMIT 10000) AS U JOIN LATERAL (SELECT * FROM Posts AS P WHERE P.OwnerUserId = U.Id ORDER BY P.Score DESC LIMIT 5) AS P
sede
CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15), Workshop_Group_ID INTEGER, Product_Description VARCHAR(255), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4), Other_Product_Service_Details VARCHAR(255) ) CREATE TABLE Bookings ( Booking_ID INTEGER, Custo...
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY payment_method_code DESC
nvbench
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code DESC
nvbench
CREATE TABLE authors ( authid VARCHAR, fname VARCHAR, lname VARCHAR ) CREATE TABLE papers ( paperid VARCHAR ) CREATE TABLE authorship ( authid VARCHAR, paperid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many papers have 'Atsushi Oho...
SELECT COUNT(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Atsushi" AND t1.lname = "Ohori"
sql_create_context
CREATE TABLE table_11421 ( "Number & name" text, "Description" text, "Current status" text, "Livery" text, "Date" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's Number & Name listed for the Date 1967?
SELECT "Number & name" FROM table_11421 WHERE "Date" = '1967'
wikisql
CREATE TABLE home_game ( YEAR VARCHAR, attendance INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of attendance at home games for each year?
SELECT YEAR, AVG(attendance) FROM home_game GROUP BY YEAR
sql_create_context
CREATE TABLE table_68655 ( "Stadium" text, "Years" text, "Played" real, "Wins" real, "Losses" real, "Draw" text, "Win Percentage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games did they play in 1905?
SELECT AVG("Played") FROM table_68655 WHERE "Years" = '1905'
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 jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz...
css
CREATE TABLE table_1242447_2 ( strongs__number VARCHAR, hebrew_word VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the strongs # for the hebrew word ?
SELECT strongs__number FROM table_1242447_2 WHERE hebrew_word = "יִרְמְיָה"
sql_create_context
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 ta ( campus_job_id int, student_id int, location varchar ) CREATE TAB...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Advanced Energy Solutions%' OR name LIKE '%Advanced Energy Solutions%') AND credits = 16
advising
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE table_name_99 ( position VARCHAR, cfl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does the player from the Toronto Argonauts play?
SELECT position FROM table_name_99 WHERE cfl_team = "toronto argonauts"
sql_create_context
CREATE TABLE Customer ( CustomerId integer, FirstName varchar(40), LastName varchar(20), Company varchar(80), Address varchar(70), City varchar(40), State varchar(40), Country varchar(40), PostalCode varchar(10), Phone varchar(24), Fax varchar(24), Email varchar(60), ...
SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone) DESC
nvbench
CREATE TABLE table_204_346 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "result" text, "competition" text, "scored" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the opponent who barr scored against wh...
SELECT "opponent" FROM table_204_346 GROUP BY "opponent" HAVING COUNT(*) > 1
squall
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 COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '4403555' AND qtb.IN_HOSP_DATE BETWEEN '2006-06-25' AND '2021-02-22' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '4403555' AND gyb.IN_HOSP_DATE BETWEEN '2006-06-25' AND '2021-02-22' AND g...
css
CREATE TABLE table_name_53 ( declination___j2000__ VARCHAR, constellation VARCHAR, object_type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the constellation scorpius and object of planetary nebula, what was the declination (J2000)?
SELECT declination___j2000__ FROM table_name_53 WHERE constellation = "scorpius" AND object_type = "planetary nebula"
sql_create_context
CREATE TABLE table_name_72 ( quantity INTEGER, manufacturer VARCHAR, gwr_nos VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest quantity for GWR Nos. 696, 779, 93 5 from the manufacturer Peckett and Sons?
SELECT MIN(quantity) FROM table_name_72 WHERE manufacturer = "peckett and sons" AND gwr_nos = "696, 779, 93 5"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( ...
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28484) AND prescriptions.drug = 'normocarb' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-63 month')
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number,...
SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '5808487' AND BGRQ BETWEEN '2007-09-15' AND '2018-07-23' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL)
css
CREATE TABLE table_21260 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT "Team(s)" FROM table_21260 WHERE "Winnings" = '$81,690'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
(SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '33312894581') INTERSECT (SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '31529825688')
css
CREATE TABLE table_name_4 ( hanja VARCHAR, rr_romaja VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Hanja for the hamgyeong RR Romaja?
SELECT hanja FROM table_name_4 WHERE rr_romaja = "hamgyeong"
sql_create_context
CREATE TABLE table_name_75 ( nation VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the nation that had 59 totals?
SELECT nation FROM table_name_75 WHERE total = 59
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Neonatal thrombocytopen" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_name_64 ( calorie VARCHAR, watt_hour VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many calories is 1 watt hour?
SELECT calorie FROM table_name_64 WHERE watt_hour = "1"
sql_create_context
CREATE TABLE table_34398 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "1st prize ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location of the byron nelson golf classic?
SELECT "Location" FROM table_34398 WHERE "Tournament" = 'byron nelson golf classic'
wikisql
CREATE TABLE table_name_70 ( branding VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Branding of Frequency 00 94.5?
SELECT branding FROM table_name_70 WHERE frequency = "00 94.5"
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 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 = "29690" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_31 ( prize VARCHAR, entrants VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What prize amount was awarded at the event with 453 entrants?
SELECT prize FROM table_name_31 WHERE entrants = 453
sql_create_context
CREATE TABLE table_name_67 ( city VARCHAR, iata VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is City, when IATA is 'amm'?
SELECT city FROM table_name_67 WHERE iata = "amm"
sql_create_context
CREATE TABLE table_43442 ( "Position" real, "Club" text, "Games played" real, "Wins" real, "Draws" real, "Loses" real, "Goals scored" real, "Goals conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the su...
SELECT SUM("Points") FROM table_43442 WHERE "Goals conceded" < '51' AND "Position" > '1' AND "Draws" = '7' AND "Loses" > '5'
wikisql
CREATE TABLE table_name_25 ( entrant VARCHAR, points VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the entrant when the points is 42 (45) and the chassis is brabham bt20?
SELECT entrant FROM table_name_25 WHERE points = "42 (45)" AND chassis = "brabham bt20"
sql_create_context
CREATE TABLE table_43704 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Worldwide Gross" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Director of the Film The Fugitive?
SELECT "Director" FROM table_43704 WHERE "Title" = 'the fugitive'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT COUNT(DISTINCT IN_DIAG_DIS_CD) FROM t_kc21 WHERE PERSON_ID = '23539348' AND IN_HOSP_DATE BETWEEN '2016-10-28' AND '2017-09-19'
css
CREATE TABLE table_18461635_1 ( coach VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the coach of the team in Leicester?
SELECT coach FROM table_18461635_1 WHERE location = "Leicester"
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "2" AND procedures.icd9_code = "9744"
mimicsql_data
CREATE TABLE table_2651755_1 ( democratic_coalition VARCHAR, together_we_can_do_more VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the democratic coalation when together we can do more is sergio castro ( pc )?
SELECT democratic_coalition FROM table_2651755_1 WHERE together_we_can_do_more = "Sergio Castro ( PC )"
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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...
SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME DESC
nvbench
CREATE TABLE table_7491 ( "1st built" real, "1913 Class" text, "W.A." text, "No. Built" real, "Builder" text, "Date" text, "LNER Class" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1913 Class of the d32 LNER Class?
SELECT "1913 Class" FROM table_7491 WHERE "LNER Class" = 'd32'
wikisql
CREATE TABLE table_name_22 ( partner VARCHAR, surface VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was his partner when he played on carpet?
SELECT partner FROM table_name_22 WHERE surface = "carpet"
sql_create_context
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, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', treatment.treatmenttime) = '2105' GROUP BY treatment.t...
eicu
CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Draft_Class text, ...
SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Class
nvbench
CREATE TABLE table_name_76 ( median_family_income VARCHAR, median_household_income VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Median Family Income, when Median Household Income is '$50,717'?
SELECT median_family_income FROM table_name_76 WHERE median_household_income = "$50,717"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND 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_MZJZ...
css
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id numb...
SELECT COUNT(*), at.TagName FROM PostTags AS a JOIN PostTags AS b ON (a.PostId = b.PostId) JOIN Tags AS at ON (a.TagId = at.Id) JOIN Tags AS bt ON (b.TagId = bt.Id) WHERE bt.TagName = 'homework' AND at.TagName != 'homework' GROUP BY at.TagName ORDER BY 1 DESC
sede
CREATE TABLE table_name_71 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is 2007 when 2011 is not held and 2012 is not held?
SELECT 2007 FROM table_name_71 WHERE 2011 = "not held" AND 2012 = "not held"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '曹云飞' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 6638.96)
css
CREATE TABLE Ref_Attraction_Types ( Attraction_Type_Code CHAR(15), Attraction_Type_Description VARCHAR(255) ) CREATE TABLE Theme_Parks ( Theme_Park_ID INTEGER, Theme_Park_Details VARCHAR(255) ) CREATE TABLE Shops ( Shop_ID INTEGER, Shop_Details VARCHAR(255) ) CREATE TABLE Ref_Hotel_Star_Ratin...
SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Tourist_Attraction_ID
nvbench
CREATE TABLE table_204_215 ( id number, "airline" text, "destination(s)" text, "aircraft scheduled" text, "service date(s)" text, "comments" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the only airline that has filed for bankruptcy as...
SELECT "airline" FROM table_204_215 WHERE "comments" = 'filed for bankruptcy'
squall
CREATE TABLE table_name_6 ( maltese VARCHAR, malay VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Maltese word for the Malay word rabu?
SELECT maltese FROM table_name_6 WHERE malay = "rabu"
sql_create_context
CREATE TABLE table_26338 ( "Team #1" text, "Points" text, "Team #2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team number 1 for san lorenzo
SELECT "Team #1" FROM table_26338 WHERE "Team #2" = 'San Lorenzo'
wikisql
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, nu...
SELECT DISTINCT title, year FROM paper WHERE title = 'A Switching Architecture For ISDN'
scholar
CREATE TABLE table_name_89 ( original_airdate VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the original air date when ed horowitz wrote it?
SELECT original_airdate FROM table_name_89 WHERE written_by = "ed horowitz"
sql_create_context
CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destr...
SELECT Destruction_Authorised_by_Employee_ID, COUNT(*) FROM Documents_to_be_Destroyed GROUP BY Destruction_Authorised_by_Employee_ID
nvbench
CREATE TABLE table_24379 ( "#" real, "Japanese title" text, "R\u014dmaji" text, "Japanese translation" text, "Vocalist" text, "Episodes used" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of vocalists for which one ~ is it?
SELECT COUNT("Vocalist") FROM table_24379 WHERE "Japanese translation" = 'Which One ~ Is It?'
wikisql
CREATE TABLE table_204_29 ( id number, "rank" number, "lane" number, "name" text, "nationality" text, "time" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many athletes finished after 2:00:00 ?
SELECT COUNT("name") FROM table_204_29 WHERE "time" >= 2
squall
CREATE TABLE table_name_26 ( lost INTEGER, team VARCHAR, draw VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what the most lost for Alianza with a draw less than 6?
SELECT MAX(lost) FROM table_name_26 WHERE team = "alianza" AND draw < 6
sql_create_context
CREATE TABLE table_54124 ( "Player" text, "Car." real, "Yards" real, "Avg." real, "TD's" real, "Long" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average for the player with 1 TD, over 4 as a long, and under 1 carry?
SELECT MIN("Avg.") FROM table_54124 WHERE "TD's" = '1' AND "Long" > '4' AND "Car." < '1'
wikisql
CREATE TABLE table_50845 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the home team on 31 January 1951 when away team was Sheffield United?
SELECT "Home team" FROM table_50845 WHERE "Date" = '31 january 1951' AND "Away team" = 'sheffield united'
wikisql