instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE chartevents ( row_id number, subject_id number, had...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20713) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', labevents.charttime) = '03'
mimic_iii
CREATE TABLE table_11222744_3 ( catalog_number VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the catalog number named callanetics: 10 years younger in 10 hours
SELECT catalog_number FROM table_11222744_3 WHERE title = "Callanetics: 10 years Younger In 10 Hours"
sql_create_context
CREATE TABLE table_name_14 ( average INTEGER, goalkeeper VARCHAR, matches VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average of the team who has Jacobo as a goalkeeper and has played more than 32 matches?
SELECT AVG(average) FROM table_name_14 WHERE goalkeeper = "jacobo" AND matches > 32
sql_create_context
CREATE TABLE performance ( Attendance VARCHAR, LOCATION VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the attendances of the performances at location 'TD Garden' or 'Bell Centre
SELECT Attendance FROM performance WHERE LOCATION = "TD Garden" OR LOCATION = "Bell Centre"
sql_create_context
CREATE TABLE table_name_67 ( week INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Week with the Opponent Buffalo Bills?
SELECT MAX(week) FROM table_name_67 WHERE opponent = "buffalo bills"
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '00220409' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '4636')
css
CREATE TABLE table_37783 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What loss has 16-6 as the record?
SELECT "Loss" FROM table_37783 WHERE "Record" = '16-6'
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID
nvbench
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city...
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY Rank
nvbench
CREATE TABLE table_name_67 ( marriage VARCHAR, death VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the marriage date for the Habsburg-Lorraine house member who died 29 December 1829?
SELECT marriage FROM table_name_67 WHERE death = "29 december 1829"
sql_create_context
CREATE TABLE table_24166 ( "Member countries" text, "Population" real, "Area (km\u00b2)" real, "GDP (billion US$)" text, "GDP per capita (US$)" real, "Languages" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most gdp per capita latvian...
SELECT MAX("GDP per capita (US$)") FROM table_24166 WHERE "Languages" = 'Latvian'
wikisql
CREATE TABLE table_name_36 ( max_torque_at_rpm VARCHAR, displacement VARCHAR, engine VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum torque that has 2,445 CC Displacement, and an Iveco 8144.61 engine?
SELECT max_torque_at_rpm FROM table_name_36 WHERE displacement = "2,445 cc" AND engine = "iveco 8144.61"
sql_create_context
CREATE TABLE table_234886_3 ( directed_by VARCHAR, no_in_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed episode no. 44 in the series?
SELECT directed_by FROM table_234886_3 WHERE no_in_series = 44
sql_create_context
CREATE TABLE table_name_52 ( team VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the team when vince carter (19) had the high points?
SELECT team FROM table_name_52 WHERE high_points = "vince carter (19)"
sql_create_context
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 DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE area.area LIKE '%human computer interaction%' AND program_course.workload < (SELECT MIN(P...
advising
CREATE TABLE table_22650 ( "Year" real, "Player" text, "Country" text, "Score" text, "To Par" text, "Margin" real, "Earnings ($)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score to par won in 1998?
SELECT "To Par" FROM table_22650 WHERE "Year" = '1998'
wikisql
CREATE TABLE table_203_739 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in the 2003 summer universiade , which countries had more gold me...
SELECT "nation" FROM table_203_739 WHERE "gold" > (SELECT "gold" FROM table_203_739 WHERE "nation" = 'japan')
squall
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) -- Using valid SQLite, answer the following questions ...
SELECT Country, COUNT(*) FROM climber GROUP BY Country ORDER BY COUNT(*)
nvbench
CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE member ( Member_ID int, ...
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "RIS1L"
mimicsql_data
CREATE TABLE table_name_20 ( venue VARCHAR, round VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In Round 19, where did Tony Lockett play?
SELECT venue FROM table_name_20 WHERE round = "19" AND player = "tony lockett"
sql_create_context
CREATE TABLE table_name_38 ( player VARCHAR, nationality VARCHAR, college_junior_club_team__league_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player is from the United States, and played for the Bowling Green Falcons (CCHA) as their College/Ju...
SELECT player FROM table_name_38 WHERE nationality = "united states" AND college_junior_club_team__league_ = "bowling green falcons (ccha)"
sql_create_context
CREATE TABLE table_name_34 ( away_captain VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the away captain at Brisbane Cricket Ground?
SELECT away_captain FROM table_name_34 WHERE venue = "brisbane cricket ground"
sql_create_context
CREATE TABLE circuits ( circuitId INTEGER, circuitRef TEXT, name TEXT, location TEXT, country TEXT, lat REAL, lng REAL, alt TEXT, url TEXT ) CREATE TABLE races ( raceId INTEGER, year INTEGER, round INTEGER, circuitId INTEGER, name TEXT, date TEXT, time TE...
SELECT year, COUNT(year) FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T1.driverId = T3.driverId WHERE T3.forename = "Lewis" ORDER BY year
nvbench
CREATE TABLE participants ( participant_id number, participant_type_code text, participant_details text ) CREATE TABLE services ( service_id number, service_type_code text ) CREATE TABLE participants_in_events ( event_id number, participant_id number ) CREATE TABLE events ( event_id n...
SELECT COUNT(*) FROM events WHERE NOT event_id IN (SELECT event_id FROM participants_in_events)
spider
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE cost ( row_id number, subject_id number, hadm...
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'alkalosis'...
mimic_iii
CREATE TABLE table_59200 ( "Year" real, "Lok Sabha" text, "Members of Parliament" text, "Party Won" text, "Winner's % votes" text, "Trailing Party" text, "Trailing Party % votes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Members...
SELECT "Members of Parliament" FROM table_59200 WHERE "Trailing Party" = 'bharatiya lok dal'
wikisql
CREATE TABLE table_name_49 ( film VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What film was filmed in Spain?
SELECT film FROM table_name_49 WHERE country = "spain"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Road, School_ID FROM basketball_match ORDER BY All_Road DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
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_41641 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Date that had a Result of draw, with Oval as a venue?
SELECT "Date" FROM table_41641 WHERE "Result" = 'draw' AND "Venue" = 'oval'
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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH"
mimicsql_data
CREATE TABLE table_19235 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the maximum crowd whe...
SELECT MAX("Crowd") FROM table_19235 WHERE "Ground" = 'SCG'
wikisql
CREATE TABLE table_name_55 ( games INTEGER, rank INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of games of the player with a rank less than 1?
SELECT AVG(games) FROM table_name_55 WHERE rank < 1
sql_create_context
CREATE TABLE table_17355716_5 ( team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team for november 5
SELECT team FROM table_17355716_5 WHERE date = "November 5"
sql_create_context
CREATE TABLE table_49325 ( "Season" text, "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 is the F/...
SELECT "F/Laps" FROM table_49325 WHERE "Position" = '3rd'
wikisql
CREATE TABLE table_name_44 ( college VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which college does Peyton Siva play for?
SELECT college FROM table_name_44 WHERE player = "peyton siva"
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7787217' AND t_kc22.SOC_SRT_DIRE_CD = '3265'
css
CREATE TABLE table_73542 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the first broadc...
SELECT "Original air date" FROM table_73542 WHERE "Title" = 'Truth Be Told'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 2004 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE STUDENT ...
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE, EMP_FNAME ORDER BY COUNT(EMP_FNAME)
nvbench
CREATE TABLE table_78351 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament was held on 21 May 2006?
SELECT "Tournament" FROM table_78351 WHERE "Date" = '21 may 2006'
wikisql
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 Sex, AVG(Age) FROM Student GROUP BY Sex
nvbench
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 patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '006-193056' AND STRFTIME('%y', patient.hospitaldischargetime) >= '2101' ORDER BY patient.hospitaldischargetime DESC LIMIT 1
eicu
CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Scientists ( SSN int, Name Char(30) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the names of pr...
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project WHERE T1.Hours > 300 GROUP BY T1.Name
nvbench
CREATE TABLE table_36179 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Time ( ET )" text, "Result" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Record of 3 3 has what result?
SELECT "Result" FROM table_36179 WHERE "Record" = '3–3'
wikisql
CREATE TABLE table_54821 ( "Rank" text, "Name" text, "Height m (ft)" text, "Floors" real, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of floors recorded for buildings built by Dubai Marriott Harbour Hotel & Suites...
SELECT MIN("Floors") FROM table_54821 WHERE "Name" = 'dubai marriott harbour hotel & suites'
wikisql
CREATE TABLE table_name_56 ( result VARCHAR, nationality___opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Result of new zealand Nationality / Opponent?
SELECT result FROM table_name_56 WHERE nationality___opponent = "new zealand"
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 SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '戚鸿振' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-11-12' AND '2012-08-09'
css
CREATE TABLE table_name_84 ( wickets INTEGER, career VARCHAR, maidens VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the fewest wickets when player's career spanned 1946-1960 and maidens were more than 419?
SELECT MIN(wickets) FROM table_name_84 WHERE career = "1946-1960" AND maidens > 419
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program ( program_id int, name varchar, college varc...
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'SLAVIC' AND course.number = 270 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
advising
CREATE TABLE table_name_79 ( year VARCHAR, organization VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year for the legatum institute?
SELECT year FROM table_name_79 WHERE organization = "legatum institute"
sql_create_context
CREATE TABLE table_38620 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of the team with more than...
SELECT SUM("Position") FROM table_38620 WHERE "Lost" > '16' AND "Against" > '74'
wikisql
CREATE TABLE table_18600760_2 ( longitude VARCHAR, land___sqmi__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the longitude in 35.992 sqmi
SELECT longitude FROM table_18600760_2 WHERE land___sqmi__ = "35.992"
sql_create_context
CREATE TABLE table_204_423 ( id number, "name" text, "location" text, "city" text, "listing date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which site was listed earlier , the state public school or the edwin r. clarke library ?
SELECT "name" FROM table_204_423 WHERE "name" IN ('state public school at coldwater', 'edwin r. clarke library (michigan library association)') ORDER BY "listing date" LIMIT 1
squall
CREATE TABLE table_34804 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Runner-up has a Winning score of 20 (70-69-64-65=268)?
SELECT "Runner-up" FROM table_34804 WHERE "Winning score" = '−20 (70-69-64-65=268)'
wikisql
CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, order_quantity VARCHAR(80) ) CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), co...
SELECT state_province_county, COUNT(*) FROM Addresses GROUP BY state_province_county ORDER BY state_province_county
nvbench
CREATE TABLE type_of_restaurant ( resid number, restypeid number ) CREATE TABLE restaurant ( resid number, resname text, address text, rating number ) CREATE TABLE restaurant_type ( restypeid number, restypename text, restypedescription text ) CREATE TABLE visits_restaurant ( ...
SELECT COUNT(*) FROM student JOIN visits_restaurant ON student.stuid = visits_restaurant.stuid JOIN restaurant ON visits_restaurant.resid = restaurant.resid WHERE student.fname = "Linda" AND student.lname = "Smith" AND restaurant.resname = "Subway"
spider
CREATE TABLE table_name_17 ( almaty_ VARCHAR, _kazakhstan VARCHAR, sergey_filimonov___kaz__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Almaty, Kazakhstan when Sergey Filimonov ( KAZ ) is 210kg?
SELECT almaty_, _kazakhstan FROM table_name_17 WHERE sergey_filimonov___kaz__ = "210kg"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT COUNT(*) FROM zyjzjlb WHERE JZKSDM = '4735' AND RYDJSJ BETWEEN '2006-07-05' AND '2010-01-03'
css
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, ...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fx c2 vertebra-closed') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65569) AND STRFTIME('%y', diagn...
mimic_iii
CREATE TABLE table_name_18 ( club VARCHAR, date_of_birth VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Club of the Player with a Date of Birth of 1979-01-29?
SELECT club FROM table_name_18 WHERE date_of_birth = "1979-01-29"
sql_create_context
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 EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY EMP_FNAME ORDER BY COUNT(EMP_FNAME)
nvbench
CREATE TABLE tracklists ( albumid number, position number, songid number ) CREATE TABLE vocals ( songid number, bandmate number, type text ) CREATE TABLE songs ( songid number, title text ) CREATE TABLE performance ( songid number, bandmate number, stageposition text ) CR...
SELECT * FROM albums WHERE year = 2010
spider
CREATE TABLE table_203_340 ( id number, "rank" number, "airport" text, "passengers handled" number, "% change 2011 / 12" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many passengers are going to or coming from spain ?
SELECT SUM("passengers handled") FROM table_203_340 WHERE "airport" = 'spain'
squall
CREATE TABLE table_47134 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Method for Brazil?
SELECT "Method" FROM table_47134 WHERE "Location" = 'brazil'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jybgb.JYXMDM, jybgb.JYXMMC FROM jybgb WHERE jybgb.BGDH = '71791020954'
css
CREATE TABLE table_42923 ( "Rank" real, "Location" text, "Total Passengers" real, "Annual change" text, "Capacity" real, "Capacity in use" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Annual change has a Capacity in use of 66.21%?
SELECT "Annual change" FROM table_42923 WHERE "Capacity in use" = '66.21%'
wikisql
CREATE TABLE table_45176 ( "Circuit" text, "Location / State" text, "Date" text, "Round winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the Eastern Creek Raceway located?
SELECT "Location / State" FROM table_45176 WHERE "Circuit" = 'eastern creek raceway'
wikisql
CREATE TABLE table_2344 ( "English title" text, "Russian title" text, "Published in Russian" text, "Published in English" text, "Type of work" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the russian title of the ugly swans?
SELECT "Russian title" FROM table_2344 WHERE "English title" = 'The Ugly Swans'
wikisql
CREATE TABLE table_48427 ( "Name" text, "Daytime" text, "Evening" text, "Saturday" text, "Sunday" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Daytime which has Saturday of yes and a Name of exmouth?
SELECT "Daytime" FROM table_48427 WHERE "Saturday" = 'yes' AND "Name" = 'exmouth'
wikisql
CREATE TABLE table_name_37 ( laid_down VARCHAR, pennant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the laid down date of the destroyer with a r29 pennant?
SELECT laid_down FROM table_name_37 WHERE pennant = "r29"
sql_create_context
CREATE TABLE Research_Outcomes ( outcome_code VARCHAR(10), outcome_description VARCHAR(255) ) CREATE TABLE Project_Staff ( staff_id DOUBLE, project_id INTEGER, role_code VARCHAR(10), date_from DATETIME, date_to DATETIME, other_details VARCHAR(255) ) CREATE TABLE Research_Staff ( st...
SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id
nvbench
CREATE TABLE table_10346 ( "D 50 \u221a" text, "D 49 \u221a" text, "D 48 \u221a" text, "D 47 \u221a" text, "D 46 \u221a" text, "D 45 \u221a" text, "D 44 \u221a" text, "D 43 \u221a" text, "D 42 \u221a" text, "D 41 \u221a" text ) -- Using valid SQLite, answer the following questi...
SELECT "D 46 \u221a" FROM table_10346 WHERE "D 44 \u221a" = '← majority'
wikisql
CREATE TABLE table_32166 ( "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 was the lowest Crowd total from a game in w...
SELECT MIN("Crowd") FROM table_32166 WHERE "Away team" = 'essendon'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
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 20 AND 29) AND STRFTIME('%y', treatment.treatmenttime) >= '2105' GROUP BY treatment....
eicu
CREATE TABLE table_name_86 ( position VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position was pick 32?
SELECT position FROM table_name_86 WHERE pick = 32
sql_create_context
CREATE TABLE table_34151 ( "Ship" text, "Original Pennant Number" text, "Builder" text, "Laid Down" text, "Launched" text, "Commissioned" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the commissioned date with laid down of 17 dec 1951?...
SELECT "Commissioned" FROM table_34151 WHERE "Laid Down" = '17 dec 1951'
wikisql
CREATE TABLE table_name_63 ( year VARCHAR, film_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year was the film Rang Barse introduced?
SELECT COUNT(year) FROM table_name_63 WHERE film_name = "rang barse"
sql_create_context
CREATE TABLE table_45963 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team on June 9?
SELECT "Home" FROM table_45963 WHERE "Date" = 'june 9'
wikisql
CREATE TABLE table_44493 ( "Archbishop" text, "Born" text, "Ordained Priest" text, "Ordained Bishop" text, "Appointed Archbishop" text, "Vacated throne" text, "Died" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Archbishop Albert D...
SELECT "Vacated throne" FROM table_44493 WHERE "Archbishop" = 'albert daeger'
wikisql
CREATE TABLE table_6163 ( "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 round that the player from USF was picked in when his draft pick nu...
SELECT AVG("Round") FROM table_6163 WHERE "College" = 'usf' AND "Pick #" < '24'
wikisql
CREATE TABLE table_name_95 ( length VARCHAR, race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the length of the First Union six hours at the Glen?
SELECT length FROM table_name_95 WHERE race = "first union six hours at the glen"
sql_create_context
CREATE TABLE table_43469 ( "Index" text, "Name" text, "Song" text, "Group Song" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score of ?
SELECT "Score" FROM table_43469 WHERE "Song" = '我等的人会是谁'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '陈雅惠' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE customer ( cust_ID varchar(3),...
SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%'
nvbench
CREATE TABLE table_21655290_1 ( director VARCHAR, original_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the director of kon-tiki original title?
SELECT director FROM table_21655290_1 WHERE original_title = "Kon-Tiki"
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour...
advising
CREATE TABLE table_46132 ( "First Vice President" text, "Second Vice President" text, "Third Vice president" text, "Inaugurated" text, "Left Office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Third Vice President, when Second Vice Presid...
SELECT "Third Vice president" FROM table_46132 WHERE "Second Vice President" = 'baudelio palma'
wikisql
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones"
nvbench
CREATE TABLE table_56645 ( "Model number" text, "sSpec number" text, "Frequency" text, "L2 cache" text, "Mult." text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" text, "Release price ( USD )" text ) -- Using valid SQLite, answer the following questions ...
SELECT "Release price ( USD )" FROM table_56645 WHERE "Model number" = 'pentium dual-core t2330'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId n...
SELECT COUNT(Id) AS num FROM Posts WHERE Tags LIKE '%python%' AND (Tags LIKE '%vba%' OR Tags LIKE '%excel%')
sede
CREATE TABLE table_name_84 ( pct VARCHAR, total_games INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the PCT when the total number of games is less than 944?
SELECT pct FROM table_name_84 WHERE total_games < 944
sql_create_context
CREATE TABLE table_name_78 ( turbo VARCHAR, model_number VARCHAR, l2_cache VARCHAR, release_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What turbo has a L2 cache of 4 256 kb, a release date of June 2013, and a Model number of core i7-4770s?
SELECT turbo FROM table_name_78 WHERE l2_cache = "4 × 256 kb" AND release_date = "june 2013" AND model_number = "core i7-4770s"
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.MZBMLX, zyjzjlb.MZZDBM, zyjzjlb.MZZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '47241272961'
css
CREATE TABLE table_37158 ( "Season" real, "Series" text, "Team Name" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Final Placing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Whic...
SELECT "Points" FROM table_37158 WHERE "Wins" = '0' AND "Final Placing" = '21st'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
SELECT COUNT(*) 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 = 27703)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'or ffp' AND ...
mimic_iii
CREATE TABLE table_64361 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college had the pick of 85?
SELECT "College" FROM table_64361 WHERE "Pick" = '85'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'st...
eicu
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, C...
SELECT Id AS "post_link", CreationDate FROM Posts WHERE Body LIKE '%bit.ly/software-small%' OR Body LIKE '%bit.ly/software-larse%' ORDER BY CreationDate DESC
sede