instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_79 ( team VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Team with average of 1.035?
SELECT team FROM table_name_79 WHERE average = 1.035
sql_create_context
CREATE TABLE table_name_63 ( points INTEGER, rank VARCHAR, draw VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of points when the ranking is 7th and the draw is less than 4?
SELECT AVG(points) FROM table_name_63 WHERE rank = "7th" AND draw < 4
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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '尤学义' AND t_kc21.MED_SER_ORG_NO = '9145514') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1
css
CREATE TABLE table_27712180_7 ( high_points VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the high points for w 90 77 (ot)
SELECT high_points FROM table_27712180_7 WHERE score = "W 90–77 (OT)"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
SELECT SUM(CASE WHEN Votes.VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes, SUM(CASE WHEN Votes.VoteTypeId = 3 THEN 1 ELSE 0 END) AS DownVotes, Votes.PostId AS "post_link" FROM Votes GROUP BY Votes.PostId HAVING SUM(CASE WHEN Votes.VoteTypeId = 3 THEN 1 ELSE 0 END) > 1
sede
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, Rejectio...
SELECT TagName, COUNT(*) FROM PostTags AS pt JOIN Posts AS q ON q.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE TagName IN ('swing') GROUP BY TagName ORDER BY COUNT(*) DESC
sede
CREATE TABLE table_22546460_4 ( best_male_mc VARCHAR, best_male_lyricist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Best Male MC if Best Album won the Best Male Lyricist?
SELECT best_male_mc FROM table_22546460_4 WHERE best_male_lyricist = "Best Album"
sql_create_context
CREATE TABLE table_10679 ( "Line" text, "Colour" text, "Route" text, "Length" text, "Stations" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of stations with a line that is u 6?
SELECT SUM("Stations") FROM table_10679 WHERE "Line" = 'u 6'
wikisql
CREATE TABLE table_26596 ( "County" text, "Coakley %" text, "Coakley votes" real, "Brown %" text, "Brown votes" real, "Kennedy %" text, "Kennedy votes" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the percentage of votes for coakl...
SELECT "Coakley %" FROM table_26596 WHERE "Kennedy %" = '1.6%'
wikisql
CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) -- Using valid SQLite, answer the following questions ...
SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country
nvbench
CREATE TABLE table_name_45 ( ceremony VARCHAR, outcome VARCHAR, nominee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ceremony was leela chitnis nominated at?
SELECT ceremony FROM table_name_45 WHERE outcome = "nominated" AND nominee = "leela chitnis"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "24" AND procedures.icd9_code = "9920"
mimicsql_data
CREATE TABLE table_21332 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On...
SELECT "Date" FROM table_21332 WHERE "High assists" = 'Dupree (6)'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "43" AND prescriptions.drug = "Bag"
mimicsql_data
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credi...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%hardw...
advising
CREATE TABLE table_name_2 ( height VARCHAR, floor_count INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What height has a floor count less than 25?
SELECT height FROM table_name_2 WHERE floor_count < 25
sql_create_context
CREATE TABLE table_47735 ( "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. -- For th...
SELECT "Score" FROM table_47735 WHERE "High points" = 'p. pierce (31)'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.long_title = "Enteral infusion of concentrated nutritional substances"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSDM = '8477' AND zyjzjlb.RYDJSJ BETWEEN '2010-02-06' AND '2020-04-25'
css
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'glycoprotein iib/iiia inhibitor - abciximab'...
eicu
CREATE TABLE table_name_80 ( tie_no VARCHAR, score VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Tie no at the Hull City Home game with a Score of 1 1?
SELECT tie_no FROM table_name_80 WHERE score = "1–1" AND home_team = "hull city"
sql_create_context
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 All_Road, ACC_Percent FROM basketball_match ORDER BY ACC_Percent
nvbench
CREATE TABLE table_name_40 ( date VARCHAR, opponent VARCHAR, game VARCHAR, location VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Date for scotiabank place with less than 20 points, game larger than 16, and an opponent of montrea...
SELECT date FROM table_name_40 WHERE location = "scotiabank place" AND points < 20 AND game > 16 AND opponent = "montreal canadiens"
sql_create_context
CREATE TABLE table_204_476 ( id number, "name" text, "date built" number, "builder" text, "works no." number, "wheels" text, "cylinders" text, "notes" text, "withdrawn" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- other than fair...
SELECT "name" FROM table_204_476 WHERE "name" <> 'fairfield' AND "date built" = 1847
squall
CREATE TABLE table_41225 ( "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What show is on at 9:00 when Law & Order: Criminal Intent is on at 9:30 and The Great American Road Trip is on at 8...
SELECT "9:00" FROM table_41225 WHERE "9:30" = 'law & order: criminal intent' AND "8:00" = 'the great american road trip'
wikisql
CREATE TABLE table_16734640_1 ( location VARCHAR, institution VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number location of georgia perimeter college
SELECT COUNT(location) FROM table_16734640_1 WHERE institution = "Georgia Perimeter College"
sql_create_context
CREATE TABLE table_32409 ( "Manager" text, "Nationality" text, "Date of Birth and Age" text, "Club" text, "Division" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the manager of the St. Johnstone club?
SELECT "Manager" FROM table_32409 WHERE "Club" = 'st. johnstone'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar,...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE (((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AN...
atis
CREATE TABLE table_26866 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At which location did 29753 fans ...
SELECT "Game site" FROM table_26866 WHERE "Attendance" = '29753'
wikisql
CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_star...
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code
nvbench
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-35874' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER...
eicu
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Paleography of Papyri%' OR course.description LIKE '%Paleography of Papyri%' OR course.name LIKE '%Paleography of Papyri%') AND course.enforced_requirement = 'N / A'
advising
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid num...
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
eicu
CREATE TABLE table_name_17 ( january VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which January has a Record of 28 14 8?
SELECT january FROM table_name_17 WHERE record = "28–14–8"
sql_create_context
CREATE TABLE station ( LOCATION VARCHAR, number_of_platforms VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all locations which don't have a train station with at least 15 platforms.
SELECT LOCATION FROM station EXCEPT SELECT LOCATION FROM station WHERE number_of_platforms >= 15
sql_create_context
CREATE TABLE table_25153 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the surface for the oppo...
SELECT "Surface" FROM table_25153 WHERE "Opponents in the final" = 'Fitzgerald Vilas'
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 mzjzjlb ( HXPLC number, HZXM ...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '王向卉' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2021-05-03')
css
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT CreationDate, Id AS "post_link" FROM Posts WHERE OwnerUserId = '##Name:int##' ORDER BY Score DESC
sede
CREATE TABLE table_name_76 ( country VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the country for the player who had a To Par of +4?
SELECT country FROM table_name_76 WHERE to_par = "+4"
sql_create_context
CREATE TABLE Engineer_Visits ( first_name VARCHAR, last_name VARCHAR, engineer_id VARCHAR ) CREATE TABLE Maintenance_Engineers ( first_name VARCHAR, last_name VARCHAR, engineer_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which engineer...
SELECT first_name, last_name FROM Maintenance_Engineers WHERE NOT engineer_id IN (SELECT engineer_id FROM Engineer_Visits)
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'oth periton adhesioly...
mimic_iii
CREATE TABLE customers ( customer_id number, customer_type_code text, address_line_1 text, address_line_2 text, town_city text, state text, email_address text, phone_number text ) CREATE TABLE staff ( staff_id number, gender text, first_name text, last_name text, ema...
SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1
spider
CREATE TABLE table_name_74 ( team VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has the points category of test driver?
SELECT team FROM table_name_74 WHERE points = "test driver"
sql_create_context
CREATE TABLE table_20090682_4 ( vehicle VARCHAR, best_time_of_day VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which vehicles got best time of day 1:17.17
SELECT vehicle FROM table_20090682_4 WHERE best_time_of_day = "1:17.17"
sql_create_context
CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Draft_Class text, College text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL tex...
SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name
nvbench
CREATE TABLE table_45385 ( "Stop no." text, "Platform" text, "Line" text, "Stopping pattern" text, "Destination" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Stop # has a Platform of [2777] mciver station platforms?
SELECT "Stop no." FROM table_45385 WHERE "Platform" = '[2777] mciver station platforms'
wikisql
CREATE TABLE table_name_94 ( format VARCHAR, catalogue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What format is catalogue WPCR13504 in?
SELECT format FROM table_name_94 WHERE catalogue = "wpcr13504"
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 SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '05261498' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2002-10-11' AND '2006-09-18' AND t_kc22.MED_INV_ITEM_TYPE = '手术费'
css
CREATE TABLE table_23937219_3 ( prod_code INTEGER, series__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the production code for episode 31 in the series?
SELECT MIN(prod_code) FROM table_23937219_3 WHERE series__number = 31
sql_create_context
CREATE TABLE table_2679061_6 ( position VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the position for pick # 103?
SELECT position FROM table_2679061_6 WHERE pick__number = 103
sql_create_context
CREATE TABLE table_25841 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What t...
SELECT "Team" FROM table_25841 WHERE "Record" = '2-5'
wikisql
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, ...
SELECT DISTINCT name, number FROM course WHERE department = 'GREEK' AND credits = 12
advising
CREATE TABLE table_name_88 ( event VARCHAR, round INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which event has a Round larger than 2?
SELECT event FROM table_name_88 WHERE round > 2
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReas...
SELECT questions.Id AS "post_link", answers.OwnerUserId AS "user_link", questions.ClosedDate, answers.CreationDate, CAST((JULIANDAY(CreationDate) - JULIANDAY(questions.ClosedDate)) * 1440.0 AS INT) AS "difference" FROM Posts AS questions INNER JOIN Posts AS answers ON answers.ParentId = questions.Id WHERE answers.Creat...
sede
CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), time_slot_id varchar(4) ) CREATE TABLE instructor ( ID varchar(5), ...
SELECT dept_name, COUNT(dept_name) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY dept_name ORDER BY COUNT(dept_name) DESC
nvbench
CREATE TABLE race ( race_id number, name text, class text, date text, track_id text ) CREATE TABLE track ( track_id number, name text, location text, seating number, year_opened number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- W...
SELECT MIN(seating), MAX(seating), AVG(seating) FROM track
spider
CREATE TABLE table_1516 ( "Institution" text, "Wins" real, "Loss" real, "Home Wins" real, "Home Losses" real, "Away Wins" real, "Away Losses" real, "Neutral Wins" real, "Neutral Losses" real, "Current Streak" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT "Institution" FROM table_1516 WHERE "Wins" = '6' AND "Current Streak" = 'Won 2'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_78205 ( "Date(s) conducted" text, "Polling organisation/client" text, "Cons" text, "Plaid Cymru" text, "Lib Dem" text, "Others" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the lead for others being 5...
SELECT "Lead" FROM table_78205 WHERE "Others" = '5%'
wikisql
CREATE TABLE table_name_21 ( to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the to par of the player of who scored 70-70=140?
SELECT to_par FROM table_name_21 WHERE score = 70 - 70 = 140
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT People_ID, Height FROM people
nvbench
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE allergy_type ( allergy text, allergytype text ) CREATE TABLE has_allergy ( stuid number, allergy text ) -- Using valid SQLite...
SELECT T1.allergy, T1.allergytype FROM allergy_type AS T1 JOIN has_allergy AS T2 ON T1.allergy = T2.allergy JOIN student AS T3 ON T3.stuid = T2.stuid WHERE T3.fname = "Lisa" ORDER BY T1.allergy
spider
CREATE TABLE table_name_2 ( outcome VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Outcome has Opponents of bob hewitt frew mcmillan?
SELECT outcome FROM table_name_2 WHERE opponents = "bob hewitt frew mcmillan"
sql_create_context
CREATE TABLE table_name_61 ( group VARCHAR, year VARCHAR, award VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For which group was Kim nominated in 2010 for Best International Actress?
SELECT group FROM table_name_61 WHERE year = 2010 AND award = "best international actress"
sql_create_context
CREATE TABLE table_name_7 ( score VARCHAR, couple VARCHAR, style VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Couple of cristi n & cheryl, and a Style of cha-cha-cha?
SELECT score FROM table_name_7 WHERE couple = "cristián & cheryl" AND style = "cha-cha-cha"
sql_create_context
CREATE TABLE table_name_5 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament was at the 2011 Cincinnati Masters?
SELECT 2011 FROM table_name_5 WHERE tournament = "cincinnati masters"
sql_create_context
CREATE TABLE table_name_32 ( rowers VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When rank is 5, what is the rowers?
SELECT rowers FROM table_name_32 WHERE rank = 5
sql_create_context
CREATE TABLE table_204_154 ( id number, "player" text, "matches" number, "innings" number, "runs" number, "average" number, "100s" number, "50s" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name a player that play in no more than 13 ...
SELECT "player" FROM table_204_154 WHERE "innings" <= 13
squall
CREATE TABLE table_27999 ( "Episode #" real, "The W\u00f8rd" text, "Guest" text, "Introductory phrase" text, "Original airdate" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the guests on a show where the produc...
SELECT "Guest" FROM table_27999 WHERE "Production code" = '6152'
wikisql
CREATE TABLE table_name_35 ( frequency VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which frequency is located in Davao?
SELECT frequency FROM table_name_35 WHERE location = "davao"
sql_create_context
CREATE TABLE table_69691 ( "Language" text, "Number" text, "percentage (%)" text, "males" text, "females" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many speak german?
SELECT "Number" FROM table_69691 WHERE "Language" = 'german'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, ...
SELECT Id AS ID, DisplayName AS Name, Reputation, LastAccessDate AS Seen FROM Users WHERE Location LIKE '%Morocco%' ORDER BY Reputation DESC LIMIT 200
sede
CREATE TABLE table_name_23 ( chord VARCHAR, minor_seventh VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the listed chord for a Minor seventh of F?
SELECT chord FROM table_name_23 WHERE minor_seventh = "f"
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.dob_year < "2167" AND procedures.short_title = "Atria septa def rep NEC"
mimicsql_data
CREATE TABLE table_56909 ( "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. -- When melbourne was the away team, what was the l...
SELECT MIN("Crowd") FROM table_56909 WHERE "Away team" = 'melbourne'
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 t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'neuro...
eicu
CREATE TABLE table_1939214_1 ( playoffs VARCHAR, league VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the team's status in the USISL Pro League playoffs?
SELECT playoffs FROM table_1939214_1 WHERE league = "USISL Pro league"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-80293')) AND medication.routeadmin = 'ng' AND STRFTIME('%y-%m',...
eicu
CREATE TABLE assignedto ( scientist number, project text ) CREATE TABLE projects ( code text, name text, hours number ) CREATE TABLE scientists ( ssn number, name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of project...
SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project WHERE T1.hours > 300 GROUP BY T1.name
spider
CREATE TABLE table_22832 ( "\u5366\u540d Name" text, "\u81ea\u7136 Nature" text, "\u5b63\u8282 Season" text, "\u6027\u60c5 Personality" text, "\u5bb6\u65cf Family" text, "\u65b9\u4f4d Direction" text, "\u610f\u7fa9 Meaning" text ) -- Using valid SQLite, answer the following questions for t...
SELECT COUNT("\u65b9\u4f4d Direction") FROM table_22832 WHERE "\u6027\u60c5 Personality" = 'Gentle'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden ...
SELECT Month, COUNT(*) FROM (SELECT Id, DATEADD(YEAR, DATEDIFF(YEAR, 0, CreationDate), 0) AS "month" FROM Posts JOIN PostTags ON PostId = Id WHERE PostTypeId IN (1, 2) AND TagId = 4452) AS tmp GROUP BY Month ORDER BY Month
sede
CREATE TABLE table_name_53 ( losing_bonus VARCHAR, drawn VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the losing bonus when drawn was 0, and there were 101 points?
SELECT losing_bonus FROM table_name_53 WHERE drawn = "0" AND points = "101"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, u...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-99743')) AND lab.labname = 'bedside glucose' AND DATETIME(lab.labresulttime, 's...
eicu
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_r...
SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15119) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1
mimic_iii
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(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1521051' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-02-07' AND '2014-05-21' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 1941.65) AS T
css
CREATE TABLE table_6715 ( "Season" text, "Competition" text, "Round" text, "Opponent" text, "Home" text, "Away" text, "Agg." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Away has a Home of 2 2?
SELECT "Away" FROM table_6715 WHERE "Home" = '2–2'
wikisql
CREATE TABLE table_name_37 ( u15_1st_quad VARCHAR, open_3rd_viii VARCHAR, u16_3rd_viii VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which U15 1st Quad had an Open 3rd VIII of BBC and U16 3rd VIII of BBC?
SELECT u15_1st_quad FROM table_name_37 WHERE open_3rd_viii = "bbc" AND u16_3rd_viii = "bbc"
sql_create_context
CREATE TABLE table_44356 ( "Game" real, "Team" text, "Score" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the series when the team is @boston and the game is smaller than 3?
SELECT "Series" FROM table_44356 WHERE "Team" = '@boston' AND "Game" < '3'
wikisql
CREATE TABLE table_23235767_1 ( surface VARCHAR, score_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every surface with a score in the final of 6 4, 6 7 (1 7) , 6 7 (4 7) , 4 6?
SELECT surface FROM table_23235767_1 WHERE score_in_the_final = "6–4, 6–7 (1–7) , 6–7 (4–7) , 4–6"
sql_create_context
CREATE TABLE table_64353 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country does Tiger Woods come from?
SELECT "Country" FROM table_64353 WHERE "Player" = 'tiger woods'
wikisql
CREATE TABLE table_40908 ( "Administrative Panel" real, "Agricultural Panel" real, "Cultural and Educational Panel" real, "Industrial and Commercial Panel" real, "Labour Panel" real, "National University of Ireland" real, "University of Dublin" real, "Nominated by the Taoiseach" real, ...
SELECT MIN("Cultural and Educational Panel") FROM table_40908 WHERE "University of Dublin" < '3' AND "Industrial and Commercial Panel" > '0' AND "Agricultural Panel" > '4'
wikisql
CREATE TABLE people ( people_id number, name text, height number, weight number, home town text ) CREATE TABLE perpetrator ( perpetrator_id number, people_id number, date text, year number, location text, country text, killed number, injured number ) -- Using valid...
SELECT T2.date FROM people AS T1 JOIN perpetrator AS T2 ON T1.people_id = T2.people_id ORDER BY T1.height DESC LIMIT 1
spider
CREATE TABLE table_70613 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent on September 9, 1979?
SELECT "Opponent" FROM table_70613 WHERE "Date" = 'september 9, 1979'
wikisql
CREATE TABLE table_54416 ( "Track" real, "Recorded" text, "Release Date" text, "Song Title" text, "Writer(s)" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date recorded for I Want to Be Free with a length of 2:12?
SELECT "Recorded" FROM table_54416 WHERE "Time" = '2:12' AND "Song Title" = 'i want to be free'
wikisql
CREATE TABLE table_2668347_17 ( candidates VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the candidates for pennsylvania 14
SELECT candidates FROM table_2668347_17 WHERE district = "Pennsylvania 14"
sql_create_context
CREATE TABLE table_name_22 ( game INTEGER, points VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average game against the New Jersey Devils with 19 points?
SELECT AVG(game) FROM table_name_22 WHERE points = 19 AND opponent = "new jersey devils"
sql_create_context
CREATE TABLE table_43151 ( "Date" text, "Tournament" text, "Location" text, "Home team" text, "Score" text, "Away team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date where Guatemala is the Away team?
SELECT "Date" FROM table_43151 WHERE "Away team" = 'guatemala'
wikisql
CREATE TABLE table_203_193 ( id number, "ship name" text, "in service" number, "project number" text, "type" text, "class" text, "comments" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- list the ships that have their class as arktika .
SELECT "ship name" FROM table_203_193 WHERE "class" = 'arktika'
squall
CREATE TABLE table_64567 ( "Name" text, "Years" text, "A-League" text, "Finals" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What finals have grant brebner as the name?
SELECT "Finals" FROM table_64567 WHERE "Name" = 'grant brebner'
wikisql
CREATE TABLE table_25391981_20 ( episode_number VARCHAR, episode VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What number episode was Week 4, Part 2?
SELECT episode_number FROM table_25391981_20 WHERE episode = "Week 4, Part 2"
sql_create_context