instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_72090 ( "District" text, "Total amount of trees" real, "Prevailing types, %" text, "Amount of old trees" text, "Amount of trees, that require replacement" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the amount of trees,...
SELECT "Amount of trees, that require replacement" FROM table_72090 WHERE "District" = 'Leninsky'
wikisql
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE month ( ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_na...
atis
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(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'diuretic - spironolactone') GROUP BY patient.uniquepid) AS t1 WHERE t1.c1 >= 2
eicu
CREATE TABLE table_15887683_15 ( television_service VARCHAR, country VARCHAR, n° VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what television service are in the united kingdom and n is greater than 854.0?
SELECT television_service FROM table_15887683_15 WHERE country = "United Kingdom" AND n° > 854.0
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE restriction ( restriction_code text, ...
SELECT DISTINCT ground_service.transport_type FROM city AS CITY_0, city AS CITY_1, ground_service WHERE (ground_service.city_code = CITY_0.city_code AND CITY_0.city_name = 'DALLAS') OR (ground_service.city_code = CITY_1.city_code AND CITY_1.city_name = 'FORT WORTH')
atis
CREATE TABLE table_30407 ( "Season" text, "Host" text, "Mens Singles" text, "Womens Singles" text, "Mens Doubles" text, "Womens Doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people are women's singles in the season of 2000/01?...
SELECT COUNT("Womens Singles") FROM table_30407 WHERE "Season" = '2000/01'
wikisql
CREATE TABLE table_72843 ( "Poll Year" text, "Winner" text, "Second" text, "Third" text, "Fourth" text, "Fifth" text, "Sixth" text, "Seventh" text, "Eighth" text, "Ninth" text, "Tenth" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT "Fourth" FROM table_72843 WHERE "Sixth" = 'Air Traffic'
wikisql
CREATE TABLE table_59559 ( "Show" text, "Date" text, "Official ratings (millions)" real, "Weekly rank" text, "Share" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Share has a weekly Rank of 8 and is dated 15 June?
SELECT "Share" FROM table_59559 WHERE "Weekly rank" = '8' AND "Date" = '15 june'
wikisql
CREATE TABLE table_203_387 ( id number, "parish est" number, "church" text, "city" text, "current bldg begun" number, "weekly collections" text, "notes" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- our lady of the assumption catholic chu...
SELECT "church" FROM table_203_387 WHERE "church" <> 'our lady of the assumption catholic church' AND "current bldg begun" = (SELECT "current bldg begun" FROM table_203_387 WHERE "church" = 'our lady of the assumption catholic church')
squall
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '25164587531' UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '25164587531'
css
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '77...
css
CREATE TABLE table_3897 ( "Position" real, "Driver" text, "Points" real, "Winnings" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many winnings does jeff gordon have?
SELECT "Winnings" FROM table_3897 WHERE "Driver" = 'Jeff Gordon'
wikisql
CREATE TABLE table_31826 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time/s of team Triumph in those races in which Triumph ranked higher than 4?
SELECT "Time" FROM table_31826 WHERE "Team" = 'triumph' AND "Rank" < '4'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( ...
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24268) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND outputevents.itemid IN (SELECT...
mimic_iii
CREATE TABLE table_6745 ( "Buechel & Manhart spelling (pronunciation)" text, "Ullrich" text, "Brandon University" text, "Deloria & Boas" text, "Dakota Mission" text, "Rood & Taylor" text, "Riggs" text, "Williamson" text, "University of Minnesota" text, "White Hat" text ) -- Usi...
SELECT "Deloria & Boas" FROM table_6745 WHERE "University of Minnesota" = 'ṭ'
wikisql
CREATE TABLE table_name_20 ( site VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Site had an Attendance of 45,000?
SELECT site FROM table_name_20 WHERE attendance = "45,000"
sql_create_context
CREATE TABLE table_6581 ( "Celebrity" text, "Famous for" text, "Entered" text, "Exited" text, "Finished" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which celebrity who was famous for being the ex busted member and TV presenter exited on day 19?
SELECT "Celebrity" FROM table_6581 WHERE "Exited" = 'day 19' AND "Famous for" = 'ex busted member and tv presenter'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TAB...
SELECT * FROM Posts WHERE ParentId IN (SELECT Id FROM Posts WHERE FavoriteCount > 2 AND NOT AcceptedAnswerId IS NULL AND Id IN (SELECT PostId FROM PostTags WHERE TagId IN (SELECT Id FROM Tags WHERE TagName LIKE '%delphi%')))
sede
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "POSA200L" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_41737 ( "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 lowest attendance at a week 15 game?
SELECT MIN("Attendance") FROM table_41737 WHERE "Week" = '15'
wikisql
CREATE TABLE table_76887 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date did Fleetcenter have a game lower than 9 with a score of 104-94?
SELECT "Date" FROM table_76887 WHERE "Location" = 'fleetcenter' AND "Game" < '9' AND "Score" = '104-94'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '31775724' AND t_kc22.STA_DATE BETWEEN '2015-01-10' AND '2016-09-10' AND t_kc21.MED_SER_ORG_NO = '4663039' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
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 instructor, course, course_offering, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course_offering.offering_id = offering_instructor.offering_id AND instructor.instructor_id = offering_instructor.instructor_id AND NOT instr...
advising
CREATE TABLE table_name_11 ( podiums VARCHAR, races VARCHAR, final_placing VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Podium has 1 Race and a Final Place of 5th?
SELECT podiums FROM table_name_11 WHERE races = "1" AND final_placing = "5th"
sql_create_context
CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) 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), ...
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY MIN(salary)
nvbench
CREATE TABLE salary ( year number, team_id text, league_id text, player_id text, salary number ) CREATE TABLE player ( player_id text, birth_year text, birth_month text, birth_day text, birth_country text, birth_state text, birth_city text, death_year text, death...
SELECT AVG(death_year - birth_year) FROM player
thehistoryofbaseball
CREATE TABLE table_34849 ( "Tournament" text, "1981" text, "1982" text, "1983" text, "1984" text, "1985" text, "1986" text, "1987" text, "1988" text, "1989" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tournament has a 19...
SELECT "Tournament" FROM table_34849 WHERE "1984" = '1r'
wikisql
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape
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 jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '28140515' AND NOT jybgb.BGDH IN (SELECT BGDH FROM jyjgzbb WHERE JCZ...
css
CREATE TABLE table_name_7 ( bronze INTEGER, rank VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Bronze is the lowest one that has a Rank of 3, and a Silver smaller than 2?
SELECT MIN(bronze) FROM table_name_7 WHERE rank = "3" AND silver < 2
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT EMAIL, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL DESC
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.dob_year < "2041"
mimicsql_data
CREATE TABLE table_name_46 ( rank VARCHAR, athletes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of Manuel Cortina Mart nez?
SELECT rank FROM table_name_46 WHERE athletes = "manuel cortina martínez"
sql_create_context
CREATE TABLE diagnoses ( 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 procedures ( ...
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 = "Preterm NEC 2000-2499g" AND prescriptions.route = "IH"
mimicsql_data
CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real ) CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text ) -- Using valid SQLite, answer the ...
SELECT Party, COUNT(*) FROM representative GROUP BY Party
nvbench
CREATE TABLE table_18113 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which party does the incumbent first elected in 1994 belong to?
SELECT "Party" FROM table_18113 WHERE "First elected" = '1994'
wikisql
CREATE TABLE table_name_92 ( place VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Place that has a Date of 22 august 2004?
SELECT place FROM table_name_92 WHERE date = "22 august 2004"
sql_create_context
CREATE TABLE degrees ( year number, campus number, degrees number ) CREATE TABLE faculty ( campus number, year number, faculty number ) CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE discipline_enrollments ( c...
SELECT COUNT(*) FROM campuses WHERE county = "Los Angeles"
spider
CREATE TABLE table_name_97 ( winner VARCHAR, course VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner for the Rome to Teramo course?
SELECT winner FROM table_name_97 WHERE course = "rome to teramo"
sql_create_context
CREATE TABLE table_26200568_16 ( losses INTEGER, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losses does Central Blues have?
SELECT MAX(losses) FROM table_26200568_16 WHERE club = "Central Blues"
sql_create_context
CREATE TABLE table_68767 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the first year of the European Championships competition?
SELECT MIN("Year") FROM table_68767 WHERE "Competition" = 'european championships'
wikisql
CREATE TABLE table_256286_23 ( meas_num INTEGER, description VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the tax supervising and conservation bill?
SELECT MIN(meas_num) FROM table_256286_23 WHERE description = "Tax Supervising and Conservation Bill"
sql_create_context
CREATE TABLE table_name_61 ( player VARCHAR, points VARCHAR, touchdowns VARCHAR, extra_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player has more than 1 Touchdowns with 0 Extra Points and less than 50 Points?
SELECT player FROM table_name_61 WHERE touchdowns > 1 AND extra_points = 0 AND points < 50
sql_create_context
CREATE TABLE table_name_54 ( score VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score with a Home with hornets?
SELECT score FROM table_name_54 WHERE home = "hornets"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd 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 = "Surgical operation with anastomosis, bypass, or graft, with natural or artificial tissues u...
mimicsql_data
CREATE TABLE table_2615 ( "Stage" real, "Stage winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Malaysian rider classification" text, "Team classification" text, "Malaysian team classification" text ) -- Using valid SQLite, an...
SELECT "Team classification" FROM table_2615 WHERE "Malaysian team classification" = 'MNCF Continental Team'
wikisql
CREATE TABLE table_name_62 ( cuts_made INTEGER, top_10 VARCHAR, wins VARCHAR, top_5 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many cuts were made when there weren't any wins but had a top-5 of 1 and a top 10 larger than 4?
SELECT SUM(cuts_made) FROM table_name_62 WHERE wins < 1 AND top_5 = 1 AND top_10 > 4
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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...
SELECT LAST_NAME, MANAGER_ID FROM employees ORDER BY LAST_NAME
nvbench
CREATE TABLE table_name_40 ( wins VARCHAR, podiums VARCHAR, series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Wins has Podiums of 0, and a Series of masters of formula 3?
SELECT wins FROM table_name_40 WHERE podiums = "0" AND series = "masters of formula 3"
sql_create_context
CREATE TABLE table_name_94 ( team VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team picked 80?
SELECT team FROM table_name_94 WHERE pick = 80
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text,...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ...
mimic_iii
CREATE TABLE table_73969 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Patient Portrayer" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the e...
SELECT "Directed by" FROM table_73969 WHERE "Production code" = '177605'
wikisql
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment)
nvbench
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'norepinephrine 4 mg/250 ml ns')
eicu
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.days_stay > "8"
mimicsql_data
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId numb...
SELECT COUNT(*) FROM Votes WHERE VoteTypeId = 4 AND CreationDate > '2018-10-18 00:00:00.000'
sede
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 text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
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 zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2002-02-23' UNI...
css
CREATE TABLE table_68002 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the margin of victory for the Mississippi Gulf Resort Classic?
SELECT "Margin of victory" FROM table_68002 WHERE "Tournament" = 'mississippi gulf resort classic'
wikisql
CREATE TABLE table_204_741 ( id number, "rank" number, "name" text, "nationality" text, "1,62" text, "1,67" text, "1,72" text, "1,75" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the last ranked competitor in ...
SELECT "name" FROM table_204_741 ORDER BY "rank" DESC LIMIT 1
squall
CREATE TABLE table_38401 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many events resulted in a top-25 less than 2?
SELECT COUNT("Events") FROM table_38401 WHERE "Top-25" < '2'
wikisql
CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, ...
SELECT g_name, rating FROM genre ORDER BY g_name
spider
CREATE TABLE table_57940 ( "Year" text, "Driver" text, "Constructor" text, "Category" text, "Location" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the driver in 1955?
SELECT "Driver" FROM table_57940 WHERE "Year" = '1955'
wikisql
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3118)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'drain out #1 ja...
mimic_iii
CREATE TABLE table_204_465 ( id number, "#" number, "temple name" text, "hangul" text, "hanja" text, "period of reign" text, "personal name" text, "relationship" text, "note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was th...
SELECT "temple name" FROM table_204_465 ORDER BY "period of reign" DESC LIMIT 1
squall
CREATE TABLE table_23685152_2 ( record VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record in the game against Eskimos?
SELECT record FROM table_23685152_2 WHERE opponent = "Eskimos"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requi...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_name_42 ( date VARCHAR, opponent_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the date when the opponent# is iowa?
SELECT date FROM table_name_42 WHERE opponent_number = "iowa"
sql_create_context
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIG...
SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE ORDER BY SUM(STU_HRS) DESC
nvbench
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 ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
SELECT meter_400, ID FROM swimmer ORDER BY ID
nvbench
CREATE TABLE table_1745843_8 ( class VARCHAR, part_4 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What class in the word with part 4 'giheizan'?
SELECT class FROM table_1745843_8 WHERE part_4 = "giheizan"
sql_create_context
CREATE TABLE table_name_67 ( score VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score with the opponent being New Zealand Warriors?
SELECT score FROM table_name_67 WHERE opponent = "new zealand warriors"
sql_create_context
CREATE TABLE table_name_43 ( shooter VARCHAR, event VARCHAR, rank_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shooter has wc munich as the event, and 8 as the rank points?
SELECT shooter FROM table_name_43 WHERE event = "wc munich" AND rank_points = "8"
sql_create_context
CREATE TABLE table_69604 ( "Polling Firm" text, "Date Published" text, "T. Papadopoulos" text, "D. Christofias" text, "I. Kasoulidis" text, "K. Themistokleous" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the percentage for T. Papadop...
SELECT "T. Papadopoulos" FROM table_69604 WHERE "I. Kasoulidis" = '27.1%'
wikisql
CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, department_id INTEGER, date_assigned_from DATETIME, job_title_code VARCHAR(10), date_assigned_to DATETIME )...
SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code
nvbench
CREATE TABLE table_51787 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average top-25 value for majors that have more than ...
SELECT AVG("Top-25") FROM table_51787 WHERE "Wins" > '0'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number...
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '018-47575' AND patient.hospitaladmitsource = 'emergency department'
eicu
CREATE TABLE table_name_34 ( away_team VARCHAR, crowd INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team played in front of 28,536 at an away stadium?
SELECT away_team AS score FROM table_name_34 WHERE crowd > 28 OFFSET 536
sql_create_context
CREATE TABLE table_204_866 ( id number, "name" text, "lifetime" text, "nationality" text, "notable as" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which nationality is top on the chart
SELECT "nationality" FROM table_204_866 WHERE id = 1
squall
CREATE TABLE table_name_58 ( bronze INTEGER, total INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of bronze when the total is smaller than 1?
SELECT AVG(bronze) FROM table_name_58 WHERE total < 1
sql_create_context
CREATE TABLE table_204_135 ( id number, "position" number, "club" text, "played" number, "points" number, "wins" number, "draws" number, "losses" number, "goals for" number, "goals against" number, "goal difference" number ) -- Using valid SQLite, answer the following quest...
SELECT "club" FROM table_204_135 WHERE "wins" = 4
squall
CREATE TABLE table_54656 ( "Name" text, "Scotland career" text, "Caps" real, "Goals" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average cap number in scotland in 1986 1998 leass than 69?
SELECT COUNT("Average") FROM table_54656 WHERE "Caps" < '69' AND "Scotland career" = '1986–1998'
wikisql
CREATE TABLE table_name_8 ( school VARCHAR, mascot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school has rebels as their mascot?
SELECT school FROM table_name_8 WHERE mascot = "rebels"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) )...
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(Date_in_Locaton_To)
nvbench
CREATE TABLE table_name_69 ( silver INTEGER, gold VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Gold of 0, and a Bronze smaller than 0 and what is the sum of the silver?
SELECT SUM(silver) FROM table_name_69 WHERE gold = 0 AND bronze < 0
sql_create_context
CREATE TABLE table_name_45 ( candidate VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the candidate that had 10 fired in week 2 (1-27-2005)?
SELECT candidate FROM table_name_45 WHERE result = "10 fired in week 2 (1-27-2005)"
sql_create_context
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
SELECT LName, COUNT(LName) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY LName
nvbench
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Fall on stair/step NEC"
mimicsql_data
CREATE TABLE table_name_66 ( nation VARCHAR, bronze VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Bronze smaller than 5, and a Silver larger than 0 is which nation?
SELECT nation FROM table_name_66 WHERE bronze < 5 AND silver > 0
sql_create_context
CREATE TABLE table_57592 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was th...
SELECT "Constructor" FROM table_57592 WHERE "Tyre" = 'c' AND "Pole position" = 'eugenio castellotti'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'agent specific therapy - calcium channel blockers overdose')
eicu
CREATE TABLE table_17156 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which years had a jersey number 55
SELECT "Years for Rockets" FROM table_17156 WHERE "No.(s)" = '55'
wikisql
CREATE TABLE table_name_40 ( year INTEGER, points VARCHAR, entrant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year with less than 3 points and Parmalat Forti Ford was the entrant?
SELECT MIN(year) FROM table_name_40 WHERE points < 3 AND entrant = "parmalat forti ford"
sql_create_context
CREATE TABLE table_204_547 ( id number, "rank" number, "lane" number, "name" text, "nationality" text, "time" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- out of all their times , which one was fastest ?
SELECT "time" FROM table_204_547 ORDER BY "time" LIMIT 1
squall
CREATE TABLE table_47704 ( "Date" text, "Flight" text, "Aircraft" text, "Registration" text, "Location" text, "Fatalities" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which flight had an aircraft of vickers viscount type 794?
SELECT "Flight" FROM table_47704 WHERE "Aircraft" = 'vickers viscount type 794'
wikisql
CREATE TABLE table_name_65 ( position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who held the Communications Rep position in 2011?
SELECT 2011 FROM table_name_65 WHERE position = "communications rep"
sql_create_context
CREATE TABLE table_64769 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Latitude" FROM table_64769 WHERE "Land ( sqmi )" < '34.401' AND "GEO ID" < '3807157722' AND "Longitude" = '-98.475995'
wikisql
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 T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code DESC
nvbench
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 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 <= '2006-05-29')
css
CREATE TABLE table_31143 ( "Season" real, "Winner" text, "Runner-up" text, "Third place" text, "Fourth place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the runner up the season that Sagawa Express came in fourth?
SELECT "Runner-up" FROM table_31143 WHERE "Fourth place" = 'Sagawa Express'
wikisql