instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_38548 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which method did pride bushido 10 have ?
SELECT "Method" FROM table_38548 WHERE "Event" = 'pride bushido 10'
wikisql
CREATE TABLE table_11406866_2 ( opponent VARCHAR, tv VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the opponent where tv is abc and game site is tampa stadium
SELECT opponent FROM table_11406866_2 WHERE tv = "ABC" AND game_site = "Tampa Stadium"
sql_create_context
CREATE TABLE table_204_101 ( id number, "#" number, "title" text, "producer(s)" text, "performer (s)" text, "sample(s)" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of songs with a length over 4 minutes ?
SELECT COUNT("title") FROM table_204_101 WHERE "length" >= 4
squall
CREATE TABLE table_204_876 ( id number, "ecclesiastical jurisdictions" text, "latin name" text, "type" text, "rite" text, "ecclesiastical province" text, "established" text, "area (km2)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- w...
SELECT "ecclesiastical jurisdictions" FROM table_204_876 WHERE "area (km2)" = '1074'
squall
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, ...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJ...
css
CREATE TABLE table_11951237_1 ( production_code INTEGER, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the production code for the show that aired on October 27, 1994?
SELECT MAX(production_code) FROM table_11951237_1 WHERE original_air_date = "October 27, 1994"
sql_create_context
CREATE TABLE table_77559 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the away team score when home team score...
SELECT "Away team score" FROM table_77559 WHERE "Home team score" = '20.12 (132)'
wikisql
CREATE TABLE table_name_33 ( venue VARCHAR, notes VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has Notes of 58.25 m, and a Competition of world championships?
SELECT venue FROM table_name_33 WHERE notes = "58.25 m" AND competition = "world championships"
sql_create_context
CREATE TABLE table_23230 ( "Institution" text, "Nickname" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the type for hobart college
SELECT "Type" FROM table_23230 WHERE "Institution" = 'Hobart College'
wikisql
CREATE TABLE table_203_476 ( id number, "no." number, "title (latin)" text, "title (english translation)" text, "subject" text, "date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many titles did not list an english translation ?
SELECT COUNT(*) FROM table_203_476 WHERE "title (english translation)" IS NULL
squall
CREATE TABLE table_204_463 ( id number, "year" number, "division" number, "league" text, "regular season" text, "playoffs" text, "open cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of times the seattle sounders has r...
SELECT COUNT(*) FROM table_204_463 WHERE "open cup" = '2nd round'
squall
CREATE TABLE Users ( user_id INTEGER, role_code VARCHAR(15), user_name VARCHAR(40), user_login VARCHAR(40), password VARCHAR(40) ) CREATE TABLE Images ( image_id INTEGER, image_alt_text VARCHAR(80), image_name VARCHAR(40), image_url VARCHAR(255) ) CREATE TABLE Document_Structures (...
SELECT role_code, COUNT(*) FROM Users GROUP BY role_code
nvbench
CREATE TABLE table_name_3 ( railway_number_s_ VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the railway number of the aw class?
SELECT railway_number_s_ FROM table_name_3 WHERE class = "aw"
sql_create_context
CREATE TABLE table_name_38 ( births__000s_ INTEGER, deaths VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average births that had a death rate of 0.4
SELECT AVG(births__000s_) FROM table_name_38 WHERE deaths = 0.4
sql_create_context
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE COURSE ( CRS_CODE...
SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE DESC
nvbench
CREATE TABLE table_name_71 ( date_of_birth VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was roshan mahanama born?
SELECT date_of_birth FROM table_name_71 WHERE player = "roshan mahanama"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_41649 ( "Year" text, "Starts" real, "Cuts Made" real, "Wins" real, "Top 10" real, "Top 25" real, "Earnings (\u20ac)" real, "Money list rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of ...
SELECT AVG("Starts") FROM table_41649 WHERE "Money list rank" = '108' AND "Top 25" > '4'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
SELECT EMPLOYEE_ID, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
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 RZBQDM, RZBQMC, RYCWH FROM zyjzjlb WHERE JZLSH = '49376399892'
css
CREATE TABLE table_7941 ( "Heat" real, "Lane" real, "Name" text, "Country" text, "Mark" text, "React" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country does Glory Alozie play for?
SELECT "Country" FROM table_7941 WHERE "Name" = 'glory alozie'
wikisql
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 d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i...
mimic_iii
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT"
mimicsql_data
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREA...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-82318')) AND diagnosis.diagnosisname = 'hiv positive - cd4 > 350' AND DA...
eicu
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY procedur...
mimic_iii
CREATE TABLE table_44199 ( "NTSC M" text, "PAL B,G,H" text, "PAL I" text, "PAL N" text, "PAL M" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NTSC M for Pal M 525/60?
SELECT "NTSC M" FROM table_44199 WHERE "PAL M" = '525/60'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text,...
WITH ClosedPostsVotes AS (SELECT p.Id AS "Post Link", SUM(CASE WHEN a.Score > 0 THEN 1 ELSE 0 END) AS Up, SUM(CASE WHEN a.Score < 0 THEN 1 ELSE 0 END) AS Down, SUM(CASE WHEN a.Score = 0 THEN 1 ELSE 0 END) AS Neutral FROM Posts AS p INNER JOIN Posts AS a ON a.ParentId = p.Id WHERE NOT p.ClosedDate IS NULL GROUP BY p.Id)...
sede
CREATE TABLE table_name_21 ( opponent VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent in game 7?
SELECT opponent FROM table_name_21 WHERE game = 7
sql_create_context
CREATE TABLE table_204_771 ( 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. -- how many countries in this competition had more than two silver m...
SELECT COUNT("nation") FROM table_204_771 WHERE "silver" > 2
squall
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour...
advising
CREATE TABLE table_19508 ( "Rank" real, "State" text, "Revenue (millions)" text, "Population" real, "Revenue per capita" text, "Spending (millions)" text, "Spending per capita" text, "Net contribution per capita" text, "Presidential majority 2000/2004" text, "Presidential majorit...
SELECT "Spending per capita" FROM table_19508 WHERE "Revenue per capita" = '$7,755'
wikisql
CREATE TABLE table_name_58 ( week INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the last week when the team had a bye week?
SELECT MAX(week) FROM table_name_58 WHERE result = "bye"
sql_create_context
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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABL...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'nystatin ointment' AND DATETIME(prescriptions.startdate, 'start o...
mimic_iii
CREATE TABLE table_7833 ( "Team" text, "Head Coach" text, "City" text, "Stadium" text, "Capacity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Capacity of the Rainer Kraft's Stadium?
SELECT AVG("Capacity") FROM table_7833 WHERE "Head Coach" = 'rainer kraft'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT p.Title, p.CreationDate, p.LastActivityDate, p.Tags, 'http://stackoverflow.com/questions/' + CAST(p.Id AS TEXT(50)) AS Link FROM Posts AS p LEFT JOIN PostLinks AS l ON l.PostId = p.Id LEFT JOIN Votes AS v ON p.Id = v.PostId WHERE p.PostTypeId = 1 AND p.AnswerCount = 0 AND p.Score <= 0 AND l.Id IS NULL AND v.Id I...
sede
CREATE TABLE table_37964 ( "Callsign" text, "Area served" text, "Frequency" text, "Band" text, "On-air ID" text, "Purpose" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the frequency with on-air ID of 1way fm
SELECT "Frequency" FROM table_37964 WHERE "On-air ID" = '1way fm'
wikisql
CREATE TABLE table_name_10 ( sodium VARCHAR, lithium VARCHAR, rubidium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the properties of sodium when lithium is h a l o g e n s and rubidium is nacl (2.1)?
SELECT sodium FROM table_name_10 WHERE lithium = "h a l o g e n s" AND rubidium = "nacl (2.1)"
sql_create_context
CREATE TABLE table_3295 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sma...
SELECT MIN("Races") FROM table_3295 WHERE "Podiums" = '11'
wikisql
CREATE TABLE table_name_61 ( team_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2nd leg for defence force
SELECT 2 AS nd_leg FROM table_name_61 WHERE team_2 = "defence force"
sql_create_context
CREATE TABLE table_19829 ( "Locale" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT COUNT("Shot Pct.") FROM table_19829 WHERE "Blank Ends" = '8'
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 prescriptions ( subject_id text, hadm_id...
SELECT demographic.name FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "VORI200"
mimicsql_data
CREATE TABLE table_14980 ( "Stage" text, "Time" text, "Name" text, "Length" text, "Winner" text, "Rally leader" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Winner of the SS5 Stage?
SELECT "Winner" FROM table_14980 WHERE "Stage" = 'ss5'
wikisql
CREATE TABLE table_73521 ( "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 l...
SELECT "Location Attendance" FROM table_73521 WHERE "High assists" = 'Russell Westbrook (5)' AND "High rebounds" = 'Nenad Krstic (8)'
wikisql
CREATE TABLE table_204_662 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number, "bye" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the number of points scored in week 3 ?
SELECT "result" + "result" FROM table_204_662 WHERE "week" = 3
squall
CREATE TABLE table_name_95 ( year INTEGER, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest year a game was played in Athens?
SELECT MIN(year) FROM table_name_95 WHERE location = "athens"
sql_create_context
CREATE TABLE table_17651 ( "#" real, "Athlete (NOC)" text, "Shooting" text, "Fencing" text, "Swimming" text, "Riding" text, "Running" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the number of the player with 68.46...
SELECT MAX("#") FROM table_17651 WHERE "Riding" = '68.46 (1144 pts)'
wikisql
CREATE TABLE table_train_207 ( "id" int, "anemia" bool, "hemoglobin_a1c_hba1c" float, "diabetic" string, "body_mass_index_bmi" float, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- hba1c > 7.5 %
SELECT * FROM table_train_207 WHERE hemoglobin_a1c_hba1c > 7.5
criteria2sql
CREATE TABLE performance ( Performance_ID real, Date text, Host text, Location text, Attendance int ) CREATE TABLE member_attendance ( Member_ID int, Performance_ID int, Num_of_Pieces int ) CREATE TABLE member ( Member_ID text, Name text, Nationality text, Role text ) ...
SELECT Location, COUNT(*) FROM performance GROUP BY Location ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_92 ( venue VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what venue is Essendon the home team?
SELECT venue FROM table_name_92 WHERE home_team = "essendon"
sql_create_context
CREATE TABLE gsi ( course_offering_id int, student_id 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_tests int, ...
SELECT DISTINCT course.department, course.name, course.number 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.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E...
advising
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE microlab ( microl...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195316' AND patient.hospitaldischargetime IS NULL)) ORDER ...
eicu
CREATE TABLE table_204_994 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the largest attendance on ...
SELECT MAX("attendance") FROM table_204_994
squall
CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE has_amenity ( dormid number, amen...
SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.IN_DIAG_DIS_CD = 'H31.774'
css
CREATE TABLE table_59497 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opposing Teams is on 06/02/1988?
SELECT "Opposing Teams" FROM table_59497 WHERE "Date" = '06/02/1988'
wikisql
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 * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_1949994_7 ( format VARCHAR, end_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the format of the season that ended on June 25?
SELECT format FROM table_1949994_7 WHERE end_date = "June 25"
sql_create_context
CREATE TABLE table_47314 ( "Year" text, "Indians admitted" real, "Pakistanis admitted" real, "Sri Lankans admitted" real, "Bangladeshis admitted" real, "Nepalis admitted" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the most Nepalis a...
SELECT MAX("Nepalis admitted") FROM table_47314 WHERE "Bangladeshis admitted" < '1,896'
wikisql
CREATE TABLE table_name_42 ( label VARCHAR, region VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What label is in download format in the United States?
SELECT label FROM table_name_42 WHERE region = "united states" AND format = "download"
sql_create_context
CREATE TABLE table_name_12 ( share VARCHAR, audience VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which share had an audience of 4.693.000?
SELECT share FROM table_name_12 WHERE audience = "4.693.000"
sql_create_context
CREATE TABLE table_14630796_1 ( class_aAA VARCHAR, school_year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of class aaa for 2006-07
SELECT COUNT(class_aAA) FROM table_14630796_1 WHERE school_year = "2006-07"
sql_create_context
CREATE TABLE inventory ( inventory_id number, film_id number, store_id number, last_update time ) CREATE TABLE actor ( actor_id number, first_name text, last_name text, last_update time ) CREATE TABLE rental ( rental_id number, rental_date time, inventory_id number, cus...
SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF'
spider
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-15837' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'bedsi...
eicu
CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text ) CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, ...
SELECT T2.dept_name, AVG(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY AVG(T1.stu_gpa) DESC LIMIT 1
spider
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '苗香馨' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-07-15' AND '2002-11-09'
css
CREATE TABLE table_name_11 ( team VARCHAR, runner_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team defeated the Capital City Giants?
SELECT team FROM table_name_11 WHERE runner_up = "capital city giants"
sql_create_context
CREATE TABLE table_55038 ( "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 the Venue was mcg what was the sum of all C...
SELECT SUM("Crowd") FROM table_55038 WHERE "Venue" = 'mcg'
wikisql
CREATE TABLE table_1341640_26 ( incumbent VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the incumbent for missouri 1?
SELECT incumbent FROM table_1341640_26 WHERE district = "Missouri 1"
sql_create_context
CREATE TABLE wdmzjzjlb ( 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 * FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '61020155' AND hz_info.YLJGDM = '2269328' AND NOT wdmzjzjlb.JZZDSM LIKE '%病理性%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND...
css
CREATE TABLE table_48083 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent has a Round smaller than 3, and a Ti...
SELECT "Opponent" FROM table_48083 WHERE "Round" < '3' AND "Time" = '1:09'
wikisql
CREATE TABLE team_franchise ( franchise_id text, franchise_name text, active text, na_assoc text ) CREATE TABLE manager_half ( player_id text, year number, team_id text, league_id text, inseason number, half number, g number, w number, l number, rank number ) CR...
SELECT COUNT(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 1907 AND T2.park_name = 'Columbia Park'
spider
CREATE TABLE genres ( name VARCHAR, id VARCHAR ) CREATE TABLE tracks ( genre_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the top 5 genres by number of tracks. List genres name and total tracks.
SELECT T1.name, COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 5
sql_create_context
CREATE TABLE table_203_818 ( id number, "kategori" text, "1995" text, "2004" text, "2005" text, "2006" text, "2007" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many categories are listed on this chart ?
SELECT COUNT("kategori") FROM table_203_818
squall
CREATE TABLE table_name_80 ( wins INTEGER, against INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of wins against the smaller score 1148?
SELECT SUM(wins) FROM table_name_80 WHERE against < 1148
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABL...
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 = 'SW' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fall' AN...
advising
CREATE TABLE table_47431 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Opponent in the Tarragona Tournament?
SELECT "Opponent" FROM table_47431 WHERE "Tournament" = 'tarragona'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABL...
SELECT UpVotes, Views FROM Users WHERE AccountId = 9464
sede
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, Di...
SELECT VotesFloor, COUNT(*) AS UserCount FROM (SELECT FLOOR((UpVotes + DownVotes) / @Interval) * @Interval AS VotesFloor FROM Users WHERE UpVotes + DownVotes > 0 AND Id > 0) AS Hist WHERE @IsRemoveLeast != 1 OR (VotesFloor != 0) GROUP BY VotesFloor ORDER BY VotesFloor DESC
sede
CREATE TABLE ftxmzjzjlb ( 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 txmzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '窦嘉美' UNION SELECT ftxmzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN ftxmzjzjlb ON person_...
css
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_i...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8569)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ar...
mimic_iii
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 Name, COUNT(Name) FROM Products GROUP BY Name
nvbench
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 instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 475 AND NOT instructor.name LIKE '%Heather Thompson%' AND offering_instructor.instructor_id = instructor.instructor_id AND o...
advising
CREATE TABLE table_1341453_11 ( results VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How did the election end for Robert Wexler?
SELECT results FROM table_1341453_11 WHERE incumbent = "Robert Wexler"
sql_create_context
CREATE TABLE table_32132 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Circuit did Johnny Wakefield win?
SELECT "Circuit" FROM table_32132 WHERE "Winning driver" = 'johnny wakefield'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 47295) AND NOT transfers.careunit IS NULL AND STRFTIME('%y', transfers.intime) = '2100' ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABL...
SELECT AnswerCount, COUNT(1) FROM (SELECT PostId FROM PostHistory WHERE PostHistoryTypeId = 10) AS Hist INNER JOIN (SELECT Id, AnswerCount FROM Posts WHERE PostTypeId = 1 AND YEAR(CreationDate) = 2020) AS Post ON Hist.PostId = Post.Id GROUP BY AnswerCount ORDER BY AnswerCount
sede
CREATE TABLE table_53973 ( "Peak" text, "metres" real, "feet" real, "Latitude (N)" text, "Longitude (E)" text, "Prominence (m)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest feet total with a Longitude (E) of 76 34 06 , and a...
SELECT MIN("feet") FROM table_53973 WHERE "Longitude (E)" = '76°34′06″' AND "Prominence (m)" < '1,701'
wikisql
CREATE TABLE table_65293 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of the athletes that have Notes of fb, and a Time of 6:47.30?
SELECT SUM("Rank") FROM table_65293 WHERE "Notes" = 'fb' AND "Time" = '6:47.30'
wikisql
CREATE TABLE table_78338 ( "Candidate" text, "Money Raised, 2Q" text, "Loans Received, 2Q" text, "Money Spent, 2Q" text, "Total Receipts" text, "Cash On Hand" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the money raised when 2Q has to...
SELECT "Money Raised, 2Q" FROM table_78338 WHERE "Total Receipts" = '$890,398'
wikisql
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Wheelchair dependence" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jybgb.SQRGH, jybgb.SQRXM FROM jybgb WHERE jybgb.BGDH = '03066452017'
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-199074')) AND DATETIME(allergy.allergytime) >= DATETIME(CURRENT_TIME(), ...
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 MED_ORG_DEPT_NM, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '8862206' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_NM HAVING AVG(PERSON_AGE) < 5
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 3929 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE table_name_40 ( season VARCHAR, pos VARCHAR, pts VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season had 6th position and 36 points?
SELECT season FROM table_name_40 WHERE pos = "6th" AND pts = "36"
sql_create_context
CREATE TABLE table_58993 ( "Driver" text, "Race 1" real, "Race 2" text, "Race 3" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many race 1's have 5 as the race 3, with points less than 59?
SELECT SUM("Race 1") FROM table_58993 WHERE "Race 3" = '5' AND "Points" < '59'
wikisql
CREATE TABLE table_name_18 ( name VARCHAR, replacement VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was replaced by Lieve Wierinck?
SELECT name FROM table_name_18 WHERE replacement = "lieve wierinck"
sql_create_context
CREATE TABLE table_name_9 ( total_passengers INTEGER, annual_change VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Total Passengers when the annual change is 9.7% and the rank is less than 6?
SELECT SUM(total_passengers) FROM table_name_9 WHERE annual_change = "9.7%" AND rank < 6
sql_create_context
CREATE TABLE table_name_62 ( home_port VARCHAR, pennant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home port of m40?
SELECT home_port FROM table_name_62 WHERE pennant = "m40"
sql_create_context