instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) CREATE TABLE student ( stuid number, ...
SELECT major FROM student GROUP BY major HAVING COUNT(*) < 3
spider
CREATE TABLE table_15605 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of finish of the Qual of 159.384?
SELECT "Finish" FROM table_15605 WHERE "Qual" = '159.384'
wikisql
CREATE TABLE table_name_99 ( gold INTEGER, nation VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Gold where the Nation is Russia (rus) and the number of silver is less than 2?
SELECT AVG(gold) FROM table_name_99 WHERE nation = "russia (rus)" AND silver < 2
sql_create_context
CREATE TABLE table_2850912_8 ( college_junior_club_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- where did glenn greenough come from
SELECT college_junior_club_team FROM table_2850912_8 WHERE player = "Glenn Greenough"
sql_create_context
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address ...
SELECT apt_type_code, COUNT(apt_type_code) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle" GROUP BY apt_type_code
nvbench
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '006-47576' AND patient.wardid = 391 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1
eicu
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "LIDO2/5J" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
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_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home
nvbench
CREATE TABLE table_name_29 ( status VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows as the status for Diogo?
SELECT status FROM table_name_29 WHERE name = "diogo"
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "31" AND procedures.long_title = "Enteral infusion of concentrated nutritional substances"
mimicsql_data
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Guests ( guest_id INTEGER, ...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date) DESC
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.dob_year < "2130"
mimicsql_data
CREATE TABLE table_15128839_22 ( tfl_yds VARCHAR, no_yds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tfl-yds for no-yds 1-0
SELECT tfl_yds FROM table_15128839_22 WHERE no_yds = "1-0"
sql_create_context
CREATE TABLE table_16441561_5 ( player VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player played DB
SELECT player FROM table_16441561_5 WHERE position = "DB"
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 zyjybgb.SQRGH, zyjybgb.SQRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '45826747535' GROUP BY zyjybgb.SQRGH HAVING COUNT(*) > 25 UNION SELECT mzjybgb.SQRGH, mzjybgb.SQRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '45826747535' GROUP BY mzjybgb.SQRGH HAVING COUNT(*) > 25
css
CREATE TABLE table_name_29 ( score VARCHAR, date VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Date is greater than 7, and when Game is '82'?
SELECT score FROM table_name_29 WHERE date > 7 AND game = 82
sql_create_context
CREATE TABLE table_34663 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who drives a BMW Sauber with a Grid larger than 2 and a Time/Retired of +15.037?
SELECT "Driver" FROM table_34663 WHERE "Grid" > '2' AND "Constructor" = 'bmw sauber' AND "Time/Retired" = '+15.037'
wikisql
CREATE TABLE table_204_193 ( id number, "year" number, "artist" text, "album" text, "chart position" text, "role" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the artist listed before ben e. king ?
SELECT "artist" FROM table_204_193 WHERE id = (SELECT id FROM table_204_193 WHERE "artist" = 'ben e. king') - 1
squall
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 qtb.MAIN_COND_DES FROM qtb WHERE qtb.MED_CLINIC_ID = '04273607781' UNION SELECT gyb.MAIN_COND_DES FROM gyb WHERE gyb.MED_CLINIC_ID = '04273607781' UNION SELECT zyb.MAIN_COND_DES FROM zyb WHERE zyb.MED_CLINIC_ID = '04273607781' UNION SELECT mzb.MAIN_COND_DES FROM mzb WHERE mzb.MED_CLINIC_ID = '04273607781'
css
CREATE TABLE table_75570 ( "Region" text, "Country" text, "Total Population (2011 est)" real, "Hindu % of population" text, "Hindu total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Total Population (2011 est) larger than 30,262,610, and a Hindu ...
SELECT "Country" FROM table_75570 WHERE "Total Population (2011 est)" > '30,262,610' AND "Hindu total" = '63,718'
wikisql
CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, ...
SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country ORDER BY Country
nvbench
CREATE TABLE product ( product_id int, product text, dimensions text, dpi real, pages_per_minute_color real, max_page_size text, interface text ) CREATE TABLE store ( Store_ID int, Store_Name text, Type text, Area_size real, Number_of_product_category real, Ranking i...
SELECT Type, COUNT(*) FROM store GROUP BY Type ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_24 ( games VARCHAR, event VARCHAR, medal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During which games did Tunisia win gold in the men's 5000 m?
SELECT games FROM table_name_24 WHERE event = "men's 5000 m" AND medal = "gold"
sql_create_context
CREATE TABLE church ( church_id number, name text, organized_by text, open_date number, continuation_of text ) CREATE TABLE people ( people_id number, name text, country text, is_male text, age number ) CREATE TABLE wedding ( church_id number, male_id number, female...
SELECT name, open_date FROM church ORDER BY open_date DESC LIMIT 3
spider
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ci...
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code
nvbench
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 AVG(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_AGE < 8)
css
CREATE TABLE table_name_65 ( overall INTEGER, pick__number VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which highest Overall has a Pick # of 4, and a Round larger than 7?
SELECT MAX(overall) FROM table_name_65 WHERE pick__number = 4 AND round > 7
sql_create_context
CREATE TABLE table_78626 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was England's total?
SELECT "Total" FROM table_78626 WHERE "Country" = 'england'
wikisql
CREATE TABLE table_11965 ( "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner of the rac...
SELECT "Race Winner" FROM table_11965 WHERE "Location" = 'monza'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '凤慧捷' AND t_kc22.STA_DATE BETWEEN '2003-03-14' AND '2017-06-09' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_73119 ( "Group 7" text, "Group 8" text, "Group 9" text, "Group 10" text, "Group 11" text, "Group 12" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played in group 12 when persikutim east kutai played in group 10?
SELECT "Group 12" FROM table_73119 WHERE "Group 10" = 'Persikutim East Kutai'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2041" AND prescriptions.route = "SL"
mimicsql_data
CREATE TABLE table_name_76 ( team_2 VARCHAR, team_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team 2 has a Team 1 of vardar?
SELECT team_2 FROM table_name_76 WHERE team_1 = "vardar"
sql_create_context
CREATE TABLE table_50546 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Away Team when the Home Team is Torquay United and the Attendence is 6 December 1997?...
SELECT "Away team" FROM table_50546 WHERE "Attendance" = '6 december 1997' AND "Home team" = 'torquay united'
wikisql
CREATE TABLE table_30712 ( "Player" text, "Nation" text, "TeBe career" text, "League matches" real, "League goals" real, "Cup matches" real, "Cup goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the years of TeBe career for the...
SELECT "TeBe career" FROM table_30712 WHERE "League matches" = '163'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy...
css
CREATE TABLE table_name_70 ( species VARCHAR, gender VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which species is male?
SELECT species FROM table_name_70 WHERE gender = "male"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23760) AND microbiologyevents.spec_type_desc = 'biopsy' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of year') = DATET...
mimic_iii
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '蒋...
css
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 Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Manufacturer)
nvbench
CREATE TABLE table_name_43 ( simplified_chinese VARCHAR, standard_order VARCHAR, transcription__based_on_pinyin_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the simplified Chinese with a standard order over 4, and the transcription of Bei Hui ...
SELECT simplified_chinese FROM table_name_43 WHERE standard_order > 4 AND transcription__based_on_pinyin_ = "bei hui feng"
sql_create_context
CREATE TABLE table_8545 ( "Club" text, "Played" 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 following questions fo...
SELECT "Drawn" FROM table_8545 WHERE "Played" = '20' AND "Club" = 'rhigos rfc'
wikisql
CREATE TABLE table_204_308 ( 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. -- what is the total number of medals for all the countries ranked f...
SELECT SUM("total") FROM table_204_308 WHERE "rank" = 4
squall
CREATE TABLE table_name_9 ( apogee VARCHAR, designation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Apogee, when Designation is Prognoz 6?
SELECT apogee FROM table_name_9 WHERE designation = "prognoz 6"
sql_create_context
CREATE TABLE company ( id int, name text, country_code varchar ) CREATE TABLE classification ( id int, msid int, gid int ) CREATE TABLE genre ( gid int, genre text ) CREATE TABLE movie ( mid int, title text, release_year int, title_aka text, budget text ) CREATE T...
SELECT writer.name FROM movie, writer, written_by WHERE movie.title = 'The Truman Show' AND written_by.msid = movie.mid AND written_by.wid = writer.wid
imdb
CREATE TABLE table_26847237_3 ( home_team VARCHAR, opposition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team when the opposition is wairarapa bush?
SELECT home_team FROM table_26847237_3 WHERE opposition = "Wairarapa Bush"
sql_create_context
CREATE TABLE table_name_47 ( bills_first_downs INTEGER, date VARCHAR, bills_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Bills first downs on Oct. 29 with more the 23 Bills points?
SELECT MIN(bills_first_downs) FROM table_name_47 WHERE date = "oct. 29" AND bills_points > 23
sql_create_context
CREATE TABLE table_7051 ( "Country" text, "Host" text, "Channel" text, "Premiere" text, "Jackpot" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the premiere on the TVB Jade Channel?
SELECT "Premiere" FROM table_7051 WHERE "Channel" = 'tvb jade'
wikisql
CREATE TABLE table_4582 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a round of 3 with a method of decision?
SELECT "Opponent" FROM table_4582 WHERE "Round" = '3' AND "Method" = 'decision'
wikisql
CREATE TABLE farm_competition ( Competition_ID int, Year int, Theme text, Host_city_ID int, Hosts text ) CREATE TABLE farm ( Farm_ID int, Year int, Total_Horses real, Working_Horses real, Total_Cattle real, Oxen real, Bulls real, Cows real, Pigs real, Sheep_a...
SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID ORDER BY Year DESC
nvbench
CREATE TABLE maintenance_contracts ( maintenance_contract_id number, maintenance_contract_company_id number, contract_start_date time, contract_end_date time, other_contract_details text ) CREATE TABLE fault_log ( fault_log_entry_id number, asset_id number, recorded_by_staff_id number, ...
SELECT DISTINCT fault_status FROM fault_log_parts
spider
CREATE TABLE table_35789 ( "Name" text, "City" text, "Years as tallest" text, "Metres" real, "Feet" real, "Floors" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the lowest Floors with Feet that's larger htan 262, has a Name of Standard B...
SELECT MIN("Floors") FROM table_35789 WHERE "Feet" > '262' AND "Name" = 'standard bank building' AND "Metres" > '138.8'
wikisql
CREATE TABLE table_69457 ( "Margin" real, "Score" text, "Opponent" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score was on 13 June 2004?
SELECT "Score" FROM table_69457 WHERE "Date" = '13 june 2004'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) 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 requirement (...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_name_57 ( since VARCHAR, goals VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Since with a Goals larger than 6, and a Name with deco?
SELECT COUNT(since) FROM table_name_57 WHERE goals > 6 AND name = "deco"
sql_create_context
CREATE TABLE table_43539 ( "Round" real, "Race Name" text, "Circuit" text, "City/Location" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round was the circuit portland international raceway?
SELECT "Round" FROM table_43539 WHERE "Circuit" = 'portland international raceway'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) 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, good_feedback int, tough_...
SELECT COUNT(*) > 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.section_number = 293 AND course.department = 'RCLANG' AND course.number = 156 AND semester.semester = 'Spring-Summer' AN...
advising
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE class_of_ser...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTON' AND days.day_name = 'SUNDAY' AND flight.flight_days = days.days_code AND ...
atis
CREATE TABLE table_name_48 ( type VARCHAR, characters VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type has the characters ?
SELECT type FROM table_name_48 WHERE characters = "廣利"
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 JOB_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID
nvbench
CREATE TABLE table_17344 ( "#" real, "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the l...
SELECT COUNT("Leading scorer") FROM table_17344 WHERE "Attendance" = 'KeyArena 16,640'
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '苗星河' AND t_kc22.STA_DATE BETWEEN '2000-07-11' AND '2017-06-02' AND t_kc21.MED_SER_ORG_NO = '0680435' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_2836 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How man...
SELECT COUNT("Team") FROM table_2836 WHERE "High rebounds" = 'Channing Frye, Jason Richardson (8)'
wikisql
CREATE TABLE table_name_48 ( score_in_the_final VARCHAR, partnering VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final score for the match with a partnering of Tessa Price?
SELECT score_in_the_final FROM table_name_48 WHERE partnering = "tessa price"
sql_create_context
CREATE TABLE table_46660 ( "Player" text, "Country" text, "Year(s) won" text, "Total" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when Player is 'Hale Irwin'?
SELECT "Country" FROM table_46660 WHERE "Player" = 'hale irwin'
wikisql
CREATE TABLE table_name_57 ( poles VARCHAR, season VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many poles did he have in 2006 with under 2 wins?
SELECT poles FROM table_name_57 WHERE season = "2006" AND wins < 2
sql_create_context
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "4" AND diagnoses.short_title = "Obs chr bronc w(ac) exac"
mimicsql_data
CREATE TABLE table_43733 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which record has a score of l 121 127?
SELECT "Record" FROM table_43733 WHERE "Score" = 'l 121–127'
wikisql
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 qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '86201848' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 4274.44) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '86201848' AND gyb.MED_CLINIC_ID IN (SELECT t...
css
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, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE (COURSE_1.number = 701 OR COURSE_1.number = 512) AND COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.depar...
advising
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND diagnoses.long_title = "Closed fracture of surgical neck of humerus"
mimicsql_data
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'COLUMBUS' AND date_day.day_number = 27 AND date_day.month_number = 6 AND ...
atis
CREATE TABLE table_26053 ( "Episode #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text, "Production code #" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest episode number...
SELECT MAX("Episode #") FROM table_26053 WHERE "Written by" = 'Harry Winkler'
wikisql
CREATE TABLE table_name_22 ( sport VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which sport has 94kg men's weightlifting as one of its events?
SELECT sport FROM table_name_22 WHERE event = "94kg men's weightlifting"
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_38741 ( "Model" text, "Processors Supported" text, "FSB/HT Frequency (MHz)" text, "Memory" text, "PCI-Express" text, "SATA" real, "PATA" real, "Sound" text, "Network" text, "Features" text ) -- Using valid SQLite, answer the following questions for the tables...
SELECT "FSB/HT Frequency (MHz)" FROM table_38741 WHERE "SATA" > '6' AND "Memory" = 'ddr 266/333/400 registered/ecc'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.admityear >= "2119"
mimicsql_data
CREATE TABLE table_59733 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue has 16 against?
SELECT "Venue" FROM table_59733 WHERE "Against" = '16'
wikisql
CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) ...
SELECT pPos, MIN(T2.HS) FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID GROUP BY pPos ORDER BY MIN(T2.HS)
nvbench
CREATE TABLE employee ( EMP_NUM VARCHAR, EMP_LNAME VARCHAR ) CREATE TABLE CLASS ( PROF_NUM VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many classes are professor whose last name is Graztevski has?
SELECT COUNT(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T1.EMP_LNAME = 'Graztevski'
sql_create_context
CREATE TABLE table_35777 ( "Rank" real, "Building" text, "City" text, "Height (m/ft)" text, "Built" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What city was the building built in 1988?
SELECT "City" FROM table_35777 WHERE "Built" = '1988'
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.admission_type = "EMERGENCY" AND demographic.ethnicity = "BLACK/HAITIAN"
mimicsql_data
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jybgb.JYXMDM, jybgb.JYXMMC FROM jybgb WHERE jybgb.BGDH = '71401875420'
css
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype tex...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id 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 =...
mimic_iii
CREATE TABLE table_25578 ( "Institution" text, "Nickname" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real, "Left" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of left for cardinals
SELECT COUNT("Left") FROM table_25578 WHERE "Nickname" = 'Cardinals'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_name_29 ( position INTEGER, lost VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE POSITION WITH A LOST OF 6, FOR CAERNARFON TOWN?
SELECT SUM(position) FROM table_name_29 WHERE lost = 6 AND team = "caernarfon town"
sql_create_context
CREATE TABLE stores ( store_id text, address_id number, marketing_region_code text, store_name text, store_phone text, store_email_address text, other_details text ) CREATE TABLE clients ( client_id number, address_id number, customer_email_address text, customer_name text, ...
SELECT T1.state_county FROM addresses AS T1 JOIN stores AS T2 ON T1.address_id = T2.address_id WHERE T2.marketing_region_code = "CA"
spider
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 JCRGH, JCRXM FROM jyjgzbb WHERE JYZBLSH = '25161863585'
css
CREATE TABLE procedures ( 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 = "ELECTIVE" AND lab."CATEGORY" = "Hematology"
mimicsql_data
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_77733 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where does center Joakim Andersson come from?
SELECT "Nationality" FROM table_77733 WHERE "Position" = 'center' AND "Player" = 'joakim andersson'
wikisql
CREATE TABLE table_204_910 ( id number, "rank" number, "name" text, "nationality" text, "result" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which country had the most competitors ranked in the top three in the event ?
SELECT "nationality" FROM table_204_910 WHERE id <= 3 GROUP BY "nationality" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_name_42 ( result VARCHAR, week VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the result when the week is earlier than 9 and attendance is 25,188?
SELECT result FROM table_name_42 WHERE week < 9 AND attendance = "25,188"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2104" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_name_15 ( attendance INTEGER, opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How low is the Attendance that has an Opponent of devil rays and a Date of may 13?
SELECT MIN(attendance) FROM table_name_15 WHERE opponent = "devil rays" AND date = "may 13"
sql_create_context
CREATE TABLE table_67483 ( "Name" text, "Discovered" real, "Museum" text, "Museum city" text, "Discoverer" text, "Formation" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What city has the museum that holds the Sue specimen...
SELECT "Museum city" FROM table_67483 WHERE "Name" = 'sue'
wikisql
CREATE TABLE table_name_48 ( gamecenter VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the gamecenter with attendance of 78,551
SELECT gamecenter FROM table_name_48 WHERE attendance = "78,551"
sql_create_context