instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_68793 ( "Institution" text, "Team" text, "City" text, "Province" text, "First season" real, "Head coach" text, "Enrollment" real, "Football stadium" text, "Capacity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- W...
SELECT "Football stadium" FROM table_68793 WHERE "Team" = 'carabins'
wikisql
CREATE TABLE table_name_3 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date which has a home team of north melbourne
SELECT date FROM table_name_3 WHERE home_team = "north melbourne"
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 COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7273767' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING MIN(gwyjzb.IN_HOSP_DAYS) > 30 UNION SELECT fgwyjzb.MED_ORG_DEPT_CD FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '7273767' GROUP BY fgwyjzb.MED_ORG_DEPT_CD HAVING MIN(fgwyjzb.IN_H...
css
CREATE TABLE table_name_63 ( swimsuit INTEGER, average VARCHAR, interview VARCHAR, evening_gown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest swimsuit score of the contestant with a higher than 9.55 interview score, and evening g...
SELECT MAX(swimsuit) FROM table_name_63 WHERE interview > 9.55 AND evening_gown = 9.75 AND average > 9.67
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE table_13045 ( "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. -- Which Nationality has a Round smaller than 3?
SELECT "Nationality" FROM table_13045 WHERE "Round" < '3'
wikisql
CREATE TABLE table_35898 ( "Order" real, "Episode" text, "Air Date" text, "U.S. Timeslot (EST)" text, "18-49" real, "Viewers" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average 18-49 for the episode that had an order number highe...
SELECT AVG("18-49") FROM table_35898 WHERE "Viewers" < '3.5' AND "Order" > '35'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "NEWBORN" AND diagnoses.icd9_code = "77081"
mimicsql_data
CREATE TABLE table_name_42 ( episode__number INTEGER, airdate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest episode # with an air date of October 31, 2001?
SELECT MIN(episode__number) FROM table_name_42 WHERE airdate = "october 31, 2001"
sql_create_context
CREATE TABLE table_204_270 ( id number, "transmitter" text, "kw" number, "bbca" number, "bbcb" number, "d3&4" number, "sdn" number, "arqa" number, "arqb" number, "pol." text, "a.g." text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT ABS((SELECT "kw" FROM table_204_270 WHERE "transmitter" = 'allenheads') - (SELECT "kw" FROM table_204_270 WHERE "transmitter" = 'seaham'))
squall
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "49392" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "74" AND prescriptions.drug = "Voriconazole"
mimicsql_data
CREATE TABLE table_204_593 ( id number, "year" text, "chairperson" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who held the position longer , t.v sivaraopantulu or l. suryalingam ?
SELECT "chairperson" FROM table_204_593 WHERE "chairperson" IN ('t.v. sivaraopantulu', 'l. suryalingam') ORDER BY "year" - "year" DESC LIMIT 1
squall
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, countr...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' AND semester.semester_id = cours...
advising
CREATE TABLE table_name_30 ( language_rebroadcast VARCHAR, branding VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the language/rebroadcast for cbc radio one?
SELECT language_rebroadcast FROM table_name_30 WHERE branding = "cbc radio one"
sql_create_context
CREATE TABLE table_name_45 ( college VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Mark Cannon's College?
SELECT college FROM table_name_45 WHERE player = "mark cannon"
sql_create_context
CREATE TABLE table_6738 ( "Date" real, "Tournament" text, "Surface" text, "Partner" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tournament has a Partner of karel nov ek?
SELECT "Tournament" FROM table_6738 WHERE "Partner" = 'karel nováček'
wikisql
CREATE TABLE table_29187 ( "Rank" real, "Rider" text, "Sat 21 Aug" text, "Mon 23 Aug" text, "Tues 24 Aug" text, "Wed 25 Aug" text, "Thurs 26 Aug" text, "Fri 27 Aug" text, "Sat 29 Aug" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- wh...
SELECT "Mon 23 Aug" FROM table_29187 WHERE "Fri 27 Aug" = '18'' 59.25 119.226mph'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
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 = 'fracture o...
mimic_iii
CREATE TABLE table_19794 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the the mens doubles with mens singles being j ...
SELECT "Mens doubles" FROM table_19794 WHERE "Mens singles" = 'Jürgen Koch' AND "Womens singles" = 'Sabine Ploner'
wikisql
CREATE TABLE table_888 ( "District" real, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "Opponent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the the incumbent with opponent being anthony weiner (d) unopposed
SELECT "Incumbent" FROM table_888 WHERE "Opponent" = 'Anthony Weiner (D) unopposed'
wikisql
CREATE TABLE table_26892 ( "Date (YYYY-MM-DD)" text, "Time (UTC)" text, "Latitude" text, "Longitude" text, "Depth" text, "Magnitude" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the depth of the aftershock at 18:00:22?
SELECT "Depth" FROM table_26892 WHERE "Time (UTC)" = '18:00:22'
wikisql
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, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(SALARY) DESC
nvbench
CREATE TABLE table_204_293 ( id number, "district" number, "name" text, "party" text, "district office" text, "first elected" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many senators are from baton rouge ?
SELECT COUNT(*) FROM table_204_293 WHERE "district office" = 'baton rouge'
squall
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE...
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 40707 AND admissions.admission_location = 'emergency room admit' AND STRFTIME('%y', admissions.admittime) = '2105'
mimic_iii
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 mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND ...
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Subarachnoid hemorrhage"
mimicsql_data
CREATE TABLE table_47956 ( "Cycle" real, "Premiere date" text, "Winner" text, "Runner-up" text, "Number of contestants" text, "International Destinations" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Premier Date, when Cycle is less th...
SELECT "Premiere date" FROM table_47956 WHERE "Cycle" < '2'
wikisql
CREATE TABLE bdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '7339851' AND wdmzjzjlb.RYDJSJ BETWEEN '2007-11-16' AND '2012-09-12' AND DATEDIFF(wdmzjzjlb.CYSJ, wdmzjzjlb.RYSJ) > 18 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '7339851' AND bdmzjzjlb.RYDJSJ BETWEEN '2007-11-16' AND '2012-09-12' AND DATEDIFF(b...
css
CREATE TABLE table_16278673_1 ( population VARCHAR, municipality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the population for s rv gur
SELECT population FROM table_16278673_1 WHERE municipality = "Sørvágur"
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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Acute kidney failure with lesion of tubular necrosis" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_17323529_5 ( high_assists VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the high assists for l 98 103 (ot)
SELECT high_assists FROM table_17323529_5 WHERE score = "L 98–103 (OT)"
sql_create_context
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '3965640' AND BGRQ BETWEEN '2006-03-22' AND '2009-01-02' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL)
css
CREATE TABLE table_17289604_38 ( athlete VARCHAR, round_of_64 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many number of athletes were in round of 64 was llagostera Vives ( esp ) l 6 2, 3 6, 5 7?
SELECT COUNT(athlete) FROM table_17289604_38 WHERE round_of_64 = "Llagostera Vives ( ESP ) L 6–2, 3–6, 5–7"
sql_create_context
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,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varc...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE table_15722 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the lowest rank for the netherlands in lane less than 4?
SELECT MIN("Rank") FROM table_15722 WHERE "Nationality" = 'netherlands' AND "Lane" < '4'
wikisql
CREATE TABLE table_name_66 ( no_2 VARCHAR, no_6 VARCHAR, no_3 VARCHAR, no_10 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the No. 2 which has a No. 3 of jacob, and a No. 10 of wyatt, and a No. 6 of ethan?
SELECT no_2 FROM table_name_66 WHERE no_3 = "jacob" AND no_10 = "wyatt" AND no_6 = "ethan"
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_name_69 ( bronze VARCHAR, rank VARCHAR, gold VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Bronze has a Gold larger than 1, and a Silver smaller than 3, and a Rank smaller than 5?
SELECT bronze FROM table_name_69 WHERE gold > 1 AND silver < 3 AND rank < 5
sql_create_context
CREATE TABLE table_1468 ( "C/W 15+" real, "Oblast\\Age" text, "15 to 17" real, "18 to 19" real, "20 to 24" real, "25 to 29" real, "30 to 34" real, "35 to 39" real, "40 to 44" real, "45 to 49" real, "50 to 54" real, "55 to 59" real, "60 to 64" real, "65 to 69" real...
SELECT MIN("25 to 29") FROM table_1468 WHERE "65 to 69" = '2417'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2126" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_67 ( weight__kg_ INTEGER, manufacturer VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Weight (kg) has a Manufacturer of fujitsu, and a Model of lifebook p1610?
SELECT AVG(weight__kg_) FROM table_name_67 WHERE manufacturer = "fujitsu" AND model = "lifebook p1610"
sql_create_context
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 Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Revenue) DESC
nvbench
CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Participants ( Participant_ID...
SELECT T1.Participant_ID, COUNT(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY Participant_Type_Code
nvbench
CREATE TABLE table_3883 ( "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 is...
SELECT MAX("Game") FROM table_3883 WHERE "Score" = 'L 96–103 (OT)'
wikisql
CREATE TABLE table_65806 ( "President" text, "Date of birth" text, "Date of inauguration" text, "Age at inauguration" text, "End of term" text, "Length of retirement" text, "Date of death" text, "Lifespan" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT "Length of retirement" FROM table_65806 WHERE "President" = 'sharma, shankar shankar dayal sharma'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.admityear >= "2120"
mimicsql_data
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80),...
SELECT family_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_28859177_3 ( original_air_date VARCHAR, directed_by VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original air date for episode graeme clifford directed and lindsay sturman wrote?
SELECT original_air_date FROM table_28859177_3 WHERE directed_by = "Graeme Clifford" AND written_by = "Lindsay Sturman"
sql_create_context
CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Draft_Class text, ...
SELECT Years_Played, COUNT(Years_Played) FROM player GROUP BY Years_Played ORDER BY Years_Played
nvbench
CREATE TABLE table_name_71 ( competition VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What competition has 17-1 as the result?
SELECT competition FROM table_name_71 WHERE result = "17-1"
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "0" AND prescriptions.drug = "SW"
mimicsql_data
CREATE TABLE table_203_485 ( id number, "year" text, "show" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the most years a show lasted ?
SELECT MAX("year" - "year") FROM table_203_485
squall
CREATE TABLE table_name_50 ( school VARCHAR, college_hall_of_fame VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the school of the player with a college hall of fame nevers hof profile?
SELECT school FROM table_name_50 WHERE college_hall_of_fame = "nevers hof profile"
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 Name, Weight FROM people ORDER BY Name 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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE diagnoses.long_title = "Perforation of intestine" AND procedures.short_title = "Packed cell transfusion"
mimicsql_data
CREATE TABLE table_17045 ( "Player" text, "Position" text, "School" text, "Hometown" text, "MLB Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the hometown of the player who attended Athens Drive High School?
SELECT "Hometown" FROM table_17045 WHERE "School" = 'Athens Drive High School'
wikisql
CREATE TABLE table_name_80 ( skip VARCHAR, lead VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has the lead on Lisa Weagle?
SELECT skip FROM table_name_80 WHERE lead = "lisa weagle"
sql_create_context
CREATE TABLE table_name_97 ( date VARCHAR, plant_patent_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date had the patent number US plant patent 12098?
SELECT date FROM table_name_97 WHERE plant_patent_number = "us plant patent 12098"
sql_create_context
CREATE TABLE table_77102 ( "Kick Off" text, "Opponents" text, "Result" text, "Referee" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT WAS THE SCORE OF THE GAME WITH A 2007-03-06, 20:45 KICKOFF?
SELECT "Result" FROM table_77102 WHERE "Kick Off" = '2007-03-06, 20:45'
wikisql
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) ...
SELECT name, ID FROM swimmer
nvbench
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate tim...
SELECT avg_days_between_badges = AVG(1. * base.days_between_badges), min_days_between_badges = MIN(1. * base.days_between_badges), max_days_between_badges = MAX(1. * base.days_between_badges), stdev_days_between_badges = STDEV(1. * base.days_between_badges) FROM (SELECT u.DisplayName, b.Name, b.Date, LastBadgeDate = LA...
sede
CREATE TABLE table_name_24 ( fire VARCHAR, metal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which fire has dry metal?
SELECT fire FROM table_name_24 WHERE metal = "dry"
sql_create_context
CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advis...
SELECT COUNT(*) FROM student
spider
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 Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Price)
nvbench
CREATE TABLE fzzmzjzjlb ( 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, MZZYZD...
SELECT zzmzjzjlb.JZKSRQ FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '26180794898' UNION SELECT fzzmzjzjlb.JZKSRQ FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '26180794898'
css
CREATE TABLE table_name_93 ( away_team VARCHAR, tie_no VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Away team that has a Tie no of replay, and a Score of 1 2?
SELECT away_team FROM table_name_93 WHERE tie_no = "replay" AND score = "1–2"
sql_create_context
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 diagnoses ( ...
SELECT lab.label FROM lab WHERE lab.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_33 ( champion VARCHAR, israel_bowl VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the champion for israel bowl of iv
SELECT champion FROM table_name_33 WHERE israel_bowl = "iv"
sql_create_context
CREATE TABLE table_2020 ( "Fiscal year" real, "2-car sets" real, "4-car sets" real, "6-car sets" real, "8-car sets" real, "Total vehicles" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest 6-car-sets for fiscal year 1968?
SELECT MAX("6-car sets") FROM table_2020 WHERE "Fiscal year" = '1968'
wikisql
CREATE TABLE table_38178 ( "Round" text, "Venue" text, "Discipline" text, "Date" text, "Winner" text, "Second" text, "Third" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue with a 3.3km c prologue discipline?
SELECT "Venue" FROM table_38178 WHERE "Discipline" = '3.3km c prologue'
wikisql
CREATE TABLE table_62310 ( "Season" real, "Team" text, "Country" text, "League" text, "Level" real, "Apps" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total levels in 2007?
SELECT SUM("Level") FROM table_62310 WHERE "Season" = '2007'
wikisql
CREATE TABLE table_name_90 ( score VARCHAR, surface VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the tournament on November 5, 2007 with a carpet surface?
SELECT score FROM table_name_90 WHERE surface = "carpet" AND date = "november 5, 2007"
sql_create_context
CREATE TABLE table_24118 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Orangemen points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent has a record of 6-2?
SELECT "Opponent" FROM table_24118 WHERE "Record" = '6-2'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Paul Edwards"
mimicsql_data
CREATE TABLE table_27753 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode that was wr...
SELECT "Directed by" FROM table_27753 WHERE "Written by" = 'Bill Lawrence'
wikisql
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE 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, ...
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '31926697' AND gwyjzb.CLINIC_TYPE = '住院' AND MOD(gwyjzb.MED_AMOUT, 1) = 0 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '31926697' AND fgwyjzb.CLINIC_TYPE = '住院' AND MOD(fgwyjzb.MED_AMOUT, 1) = 0
css
CREATE TABLE table_name_1 ( results VARCHAR, style VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the dance which had a style of contemporary jazz?
SELECT results FROM table_name_1 WHERE style = "contemporary jazz"
sql_create_context
CREATE TABLE table_48294 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a To par of 13?
SELECT "Country" FROM table_48294 WHERE "To par" = '–13'
wikisql
CREATE TABLE table_16225511_2 ( wins VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins did Baylor have?
SELECT COUNT(wins) FROM table_16225511_2 WHERE school = "Baylor"
sql_create_context
CREATE TABLE table_40020 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game against the Los Angeles Rams?
SELECT "Date" FROM table_40020 WHERE "Opponent" = 'los angeles rams'
wikisql
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE...
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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON...
atis
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 jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb 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 AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE table_48261 ( "State" text, "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Name, when State is 'Jin'?
SELECT "Name" FROM table_48261 WHERE "State" = 'jin'
wikisql
CREATE TABLE Undergoes ( Patient INTEGER, Procedures INTEGER, Stay INTEGER, DateUndergoes DATETIME, Physician INTEGER, AssistingNurse INTEGER ) CREATE TABLE Prescribes ( Physician INTEGER, Patient INTEGER, Medication INTEGER, Date DATETIME, Appointment INTEGER, Dose VARC...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_6 ( monarch VARCHAR, assumed_office VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which monarch assumed office on December 15, 1876?
SELECT monarch FROM table_name_6 WHERE assumed_office = "december 15, 1876"
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar,...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_8177 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Game, when Record is '21-30-11'?
SELECT MAX("Game") FROM table_8177 WHERE "Record" = '21-30-11'
wikisql
CREATE TABLE table_name_97 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for 2 june 2008
SELECT score FROM table_name_97 WHERE date = "2 june 2008"
sql_create_context
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cine...
SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by ORDER BY Directed_by
nvbench
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE comment_instructor ( instructor_id int, ...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 497 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_19140 ( "EDO Flight" real, "Shuttle" text, "Mission" text, "Launch Date" text, "Duration" text, "Primary Payload(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the primary payload(s) with launch date being july 8, 1...
SELECT "Primary Payload(s)" FROM table_19140 WHERE "Launch Date" = 'July 8, 1994'
wikisql
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 COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce...
eicu
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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 ...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6798056' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-02-01' AND '2011-02-17' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2'
css
CREATE TABLE table_49039 ( "Name (English)" text, "Name (German)" text, "Abbr." text, "Ideology" text, "Position" text, "Votes (2011)" text, "Seats in Hamburgische B\u00fcrgerschaft" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE...
SELECT "Seats in Hamburgische B\u00fcrgerschaft" FROM table_49039 WHERE "Ideology" = 'green politics'
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_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTE...
SELECT city_code, COUNT(*) FROM Student WHERE Sex = 'M' GROUP BY city_code
nvbench
CREATE TABLE table_name_5 ( polling_organisation_client VARCHAR, others VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the others had a value of 7%, what was the Polling organisation/client?
SELECT polling_organisation_client FROM table_name_5 WHERE others = "7%"
sql_create_context
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TAB...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'FIN' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring-...
advising
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'beta blocker - metoprolol' AND STRFTIME('%y'...
eicu
CREATE TABLE table_9949 ( "Year" text, "Kansas" text, "Nebraska" text, "North Dakota" text, "Oklahoma" text, "South Dakota" text, "Texas" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the oklahoma has Bush from Nebraska in year 2004...
SELECT "Oklahoma" FROM table_9949 WHERE "Nebraska" = 'bush' AND "Year" = '2004'
wikisql