instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.IN_DIAG_DIS_CD = 'B81.078'
css
CREATE TABLE table_name_5 ( term_end VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Fejzi Bej Alizoti's term end?
SELECT term_end FROM table_name_5 WHERE name = "fejzi bej alizoti"
sql_create_context
CREATE TABLE table_name_39 ( in_production VARCHAR, toxic_materials VARCHAR, technology VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the production if the technology is sodium-sulfur batteries and yes to toxic materials?
SELECT in_production FROM table_name_39 WHERE toxic_materials = "yes" AND technology = "sodium-sulfur batteries"
sql_create_context
CREATE TABLE table_2562572_2 ( population__1991_ VARCHAR, city___municipality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of 1991 populations named Be ej?
SELECT COUNT(population__1991_) FROM table_2562572_2 WHERE city___municipality = "Bečej"
sql_create_context
CREATE TABLE table_37186 ( "Ship" text, "Hull No." text, "Builder" text, "Home Port" text, "Commissioned\u2013 Decommissioned" text, "NVR page" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the hull number of Commissioned Decommissioned of...
SELECT "Hull No." FROM table_37186 WHERE "Commissioned\u2013 Decommissioned" = '1973–1996'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, ...
SELECT COUNT(*) FROM Users WHERE Reputation > '##MinRep##'
sede
CREATE TABLE table_32989 ( "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. -- Which Away team has Away team score 5.8 (38)?
SELECT "Away team" FROM table_32989 WHERE "Away team score" = '5.8 (38)'
wikisql
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 t_kc22.CHA_ITEM_LEV FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '79356586001' AND t_kc22.SOC_SRT_DIRE_NM = '益心舒胶囊'
css
CREATE TABLE table_11711 ( "Airing date" text, "English Title (Chinese title)" text, "Number of episodes" real, "Theme song (T) Sub-theme song (ST)" text, "Genre" text, "Official website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which genr...
SELECT "Genre" FROM table_11711 WHERE "Airing date" = '12 feb- 9 mar'
wikisql
CREATE TABLE table_name_21 ( year INTEGER, title VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year in which Requiem for a Dream was in the running for Best Director?
SELECT MIN(year) FROM table_name_21 WHERE title = "requiem for a dream" AND category = "best director"
sql_create_context
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 WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "BRADYCARDIA"
mimicsql_data
CREATE TABLE table_43282 ( "Administrative Panel" real, "Agricultural Panel" real, "Cultural and Educational Panel" real, "Industrial and Commercial Panel" real, "Labour Panel" real, "National University of Ireland" real, "University of Dublin" real, "Nominated by the Taoiseach" real, ...
SELECT MIN("Cultural and Educational Panel") FROM table_43282 WHERE "Nominated by the Taoiseach" < '5' AND "Total" > '19'
wikisql
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 t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_MED_ORG_DEPT_NM FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '5802131' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-07-23' AND '2015-10-30' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 12
css
CREATE TABLE table_2759 ( "Pos" text, "##" real, "Name" text, "Team" text, "Lap One" text, "Lap Two" text, "Lap Three" text, "Lap Four" text, "Total Time" text, "Avg. Speed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which po...
SELECT "Pos" FROM table_2759 WHERE "Lap Two" = '22.7290'
wikisql
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No...
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape
nvbench
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_requirement varchar, description varchar, num_semesters ...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id...
advising
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TA...
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'SALT LAKE CITY' AND flight.to_airport = airport_service.airport_code
atis
CREATE TABLE Gradeconversion ( lettergrade VARCHAR(2), gradepoint FLOAT ) CREATE TABLE Minor_in ( StuID INTEGER, DNO INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), B...
SELECT Days, AVG(Instructor) FROM Course GROUP BY Days ORDER BY Credits
nvbench
CREATE TABLE table_61977 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a total of 272?
SELECT "Player" FROM table_61977 WHERE "Total" = '272'
wikisql
CREATE TABLE table_name_10 ( s_no INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of people in sri lanka
SELECT AVG(s_no) FROM table_name_10 WHERE opponent = "sri lanka"
sql_create_context
CREATE TABLE table_72220 ( "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. -- What position is number 35 whose height is 6-6?
SELECT "Position" FROM table_72220 WHERE "Height in Ft." = '6-6' AND "No.(s)" = '35'
wikisql
CREATE TABLE table_204_73 ( id number, "date" text, "opponent" text, "score" text, "result" text, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many home games did they play ?
SELECT COUNT(*) FROM table_204_73 WHERE "opponent" = 'home'
squall
CREATE TABLE table_45462 ( "Year" real, "Seed" real, "Round" text, "Opponent" text, "Result/Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Result/Score, when Year is greater than 2005, and when Opponent is #8 Arkansas #1 Memphis?
SELECT "Result/Score" FROM table_45462 WHERE "Year" > '2005' AND "Opponent" = '#8 arkansas #1 memphis'
wikisql
CREATE TABLE table_14070062_4 ( won VARCHAR, points_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- tell how many wins there was when the score was 490
SELECT COUNT(won) FROM table_14070062_4 WHERE points_for = "490"
sql_create_context
CREATE TABLE table_77025 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Gold, when Nation is Canada, and when Rank is greater than 4?
SELECT MIN("Gold") FROM table_77025 WHERE "Nation" = 'canada' AND "Rank" > '4'
wikisql
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 WHERE demographic.gender = "F" AND demographic.age < "43"
mimicsql_data
CREATE TABLE table_73562 ( "Order number" text, "Build date" text, "Serial numbers" text, "Country" text, "Railroad" text, "Numbers" text, "Quantity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the numbers for the order number 71...
SELECT "Numbers" FROM table_73562 WHERE "Order number" = '713096-713119'
wikisql
CREATE TABLE table_22871239_9 ( visitor VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the visitor for march 23
SELECT visitor FROM table_22871239_9 WHERE date = "March 23"
sql_create_context
CREATE TABLE table_25745 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Original air date" FROM table_25745 WHERE "No. in season" = '22'
wikisql
CREATE TABLE table_name_7 ( opponent VARCHAR, date VARCHAR, method VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent has a Method of tko, and a Location of elgin, illinois, usa on 2001-02-11?
SELECT opponent FROM table_name_7 WHERE method = "tko" AND location = "elgin, illinois, usa" AND date = "2001-02-11"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, ...
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26886) AND DATETIME(icustays.intime) <= DATETIME(CURRENT_TIME(), '-3 year')
mimic_iii
CREATE TABLE table_59230 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is District, when Incumbent is 'Richard Neal'?
SELECT "District" FROM table_59230 WHERE "Incumbent" = 'richard neal'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
SELECT procedures.short_title FROM procedures WHERE procedures.subject_id = "6983"
mimicsql_data
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 regions ( REGION_ID decimal(5,0), ...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID
nvbench
CREATE TABLE table_69904 ( "Kanji" text, "Name" text, "Builder" text, "Laid down" text, "Launched" text, "Completed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the laid down date of Kaki?
SELECT "Laid down" FROM table_69904 WHERE "Name" = 'kaki'
wikisql
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 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 = "5770" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_name_36 ( release_date VARCHAR, title VARCHAR, developer VARCHAR, version VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Release date has a Version of 1.0, a Category of utilities, a Developer of microsof...
SELECT release_date FROM table_name_36 WHERE version = "1.0" AND category = "utilities" AND developer = "microsoft" AND title = "msn money"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT (SELECT SUM(STA_FLG) FROM t_kc22 WHERE MED_CLINIC_ID = '01708442778') = (SELECT COUNT(*) FROM t_kc22 WHERE MED_CLINIC_ID = '01708442778')
css
CREATE TABLE table_203_254 ( id number, "position" number, "team" text, "points" number, "played" number, "won" number, "drawn" number, "lost" number, "for" number, "against" number, "difference" number ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT "team" FROM table_203_254 WHERE "position" = 1
squall
CREATE TABLE table_name_41 ( team VARCHAR, best VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Team had a 1:25.602 Best?
SELECT team FROM table_name_41 WHERE best = "1:25.602"
sql_create_context
CREATE TABLE table_78694 ( "Seat Order (Right to Left)" real, "Series 1" text, "Series 2" text, "Series 3" text, "Series 5" text, "Series 9" text, "Series 11" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Series 2 has a Series 3 of de...
SELECT "Series 2" FROM table_78694 WHERE "Series 3" = 'deborah meaden'
wikisql
CREATE TABLE table_43423 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Week smaller than 11, and a Attendance of 54,094?
SELECT "Date" FROM table_43423 WHERE "Week" < '11' AND "Attendance" = '54,094'
wikisql
CREATE TABLE table_203_437 ( id number, "year" number, "laureate" text, "relation" text, "category" text, "rationale" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many laureates were in the field of physics ?
SELECT COUNT("laureate") FROM table_203_437 WHERE "category" = 'physics'
squall
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 T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T2.Revenue DESC
nvbench
CREATE TABLE table_name_62 ( losses INTEGER, year VARCHAR, finish VARCHAR, percentage VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most losses that the Royals had when they had a percentage over 0.461, won over 86 game...
SELECT MAX(losses) FROM table_name_62 WHERE percentage > 0.461 AND wins > 86 AND finish = "2nd" AND year = 1953
sql_create_context
CREATE TABLE table_23248940_6 ( record VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every record for game 11?
SELECT record FROM table_23248940_6 WHERE game = 11
sql_create_context
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
SELECT zyjybgb.BGDH FROM zyjybgb WHERE zyjybgb.JZLSH = '78415919799' AND zyjybgb.KSMC LIKE '%老年医学%' UNION SELECT mzjybgb.BGDH FROM mzjybgb WHERE mzjybgb.JZLSH = '78415919799' AND mzjybgb.KSMC LIKE '%老年医学%'
css
CREATE TABLE table_name_89 ( position VARCHAR, vehicle VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the BMW vehicle made in 2006 hold?
SELECT position FROM table_name_89 WHERE vehicle = "bmw" AND year = 2006
sql_create_context
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '41517594' AND t_kc22.STA_DATE BETWEEN '2004-09-01' AND '2015-06-04' AND t_kc22.SOC_SRT_DIRE_CD = '3992-4'
css
CREATE TABLE table_20360535_3 ( television_order VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What TV order is written by gail simone?
SELECT television_order FROM table_20360535_3 WHERE written_by = "Gail Simone"
sql_create_context
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, ...
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 ((flight.arrival_time <= 800 AND flight.arrival_time >= 0) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TORONTO' AND flight.to_airp...
atis
CREATE TABLE appellations ( no number, appelation text, county text, state text, area text, isava text ) CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number,...
SELECT DISTINCT name FROM wine ORDER BY name
spider
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, Creatio...
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
sede
CREATE TABLE Asset_Parts ( asset_id INTEGER, part_id INTEGER ) CREATE TABLE Third_Party_Companies ( company_id INTEGER, company_type VARCHAR(5), company_name VARCHAR(255), company_address VARCHAR(255), other_company_details VARCHAR(255) ) CREATE TABLE Skills ( skill_id INTEGER, ski...
SELECT fault_status, COUNT(fault_status) FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY fault_status ORDER BY fault_status DESC
nvbench
CREATE TABLE table_48330 ( "Model Number" text, "Clock Speed" text, "L2 Cache" text, "FSB Speed" text, "Clock Multiplier" text, "Voltage Range" text, "Socket" text, "Release Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Sock...
SELECT "Socket" FROM table_48330 WHERE "FSB Speed" = '400 mhz' AND "Voltage Range" = '1.004 v'
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 Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
nvbench
CREATE TABLE table_28677723_5 ( trine_dehli_cleve INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest number for trine dehli cleve?
SELECT MAX(trine_dehli_cleve) FROM table_28677723_5
sql_create_context
CREATE TABLE table_79668 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wha is the average number of bronze of hungary, which has less than 1 silver?
SELECT AVG("Bronze") FROM table_79668 WHERE "Nation" = 'hungary' AND "Silver" < '1'
wikisql
CREATE TABLE table_9838 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the event when the method was tko (punches), and the record was 7-1?
SELECT "Event" FROM table_9838 WHERE "Method" = 'tko (punches)' AND "Record" = '7-1'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '58099146' AND jyjgzbb.JYRQ BETWEEN...
css
CREATE TABLE table_name_94 ( position VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is pick 246's position?
SELECT position FROM table_name_94 WHERE pick = 246
sql_create_context
CREATE TABLE wdmzjzjlb ( 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 jyjgzbb.JCRGH, jyjgzbb.JCRXM 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....
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Albuterol-Ipratropium"
mimicsql_data
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org...
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 = 728 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.itemi...
mimic_iii
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'G21.554' AND jyjgzbb.JCZBDM = '602455' UNION SELECT jyjgzbb.CKZFWX...
css
CREATE TABLE table_name_3 ( district VARCHAR, incumbent VARCHAR, first_elected VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district is James Humphrey from who was first elected in 1858 and was eventually defeated democratic ga...
SELECT district FROM table_name_3 WHERE first_elected = 1858 AND result = "defeated democratic gain" AND incumbent = "james humphrey"
sql_create_context
CREATE TABLE table_name_35 ( opponent VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent with a Loss of Leal (1 4)?
SELECT opponent FROM table_name_35 WHERE loss = "leal (1–4)"
sql_create_context
CREATE TABLE table_name_90 ( opponent VARCHAR, site_stadium VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent at Baum Stadium on April 6?
SELECT opponent FROM table_name_90 WHERE site_stadium = "baum stadium" AND date = "april 6"
sql_create_context
CREATE TABLE table_19226 ( "Country/Territory" text, "Former pageant" text, "Last competed" real, "New pageant" text, "Franchise since" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which country has miss universe Hungary as former pageant?
SELECT "Country/Territory" FROM table_19226 WHERE "Former pageant" = 'Miss Universe Hungary'
wikisql
CREATE TABLE table_name_82 ( loss INTEGER, gain VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the sum of Loss that has the Gain of 2646?
SELECT SUM(loss) FROM table_name_82 WHERE gain = 2646
sql_create_context
CREATE TABLE table_28263 ( "AB - Angry boar" text, "B - Bishop" text, "BA - Running Bear" text, "BB - Blind Bear" text, "BC - Beast Cadet" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is ba - running bear where ab - angry boar is os - ox sold...
SELECT "BA - Running Bear" FROM table_28263 WHERE "AB - Angry boar" = 'OS - Ox Soldier'
wikisql
CREATE TABLE table_name_91 ( opponent VARCHAR, week VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent at the game with a score of 42-28 after week 4?
SELECT opponent FROM table_name_91 WHERE week > 4 AND score = "42-28"
sql_create_context
CREATE TABLE table_name_26 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did the away team score when they visited south melbourne?
SELECT away_team AS score FROM table_name_26 WHERE home_team = "south melbourne"
sql_create_context
CREATE TABLE table_69483 ( "Low Estimate" real, "High Estimate" real, "Type" text, "Location" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a type of mass suicide located in France and a low estimate greater than 16, the sum of th...
SELECT SUM("High Estimate") FROM table_69483 WHERE "Type" = 'mass suicide' AND "Location" = 'france' AND "Low Estimate" > '16'
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 WHERE diagnoses.long_title = "Unspecified disease of pericardium"
mimicsql_data
CREATE TABLE table_237036_2 ( _extended_and_main_profiles VARCHAR, baseline INTEGER, level VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the baseline extended and main profiles when level is 1.3?
SELECT MIN(baseline), _extended_and_main_profiles FROM table_237036_2 WHERE level = "1.3"
sql_create_context
CREATE TABLE table_name_33 ( goals_for VARCHAR, points_1 VARCHAR, drawn VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of goals for when the drawn is less than 7, less than 21 games have been lost, and there are...
SELECT COUNT(goals_for) FROM table_name_33 WHERE drawn < 7 AND lost < 21 AND points_1 = "33"
sql_create_context
CREATE TABLE table_78999 ( "Country" text, "Transfers In" text, "Transfers Out" text, "Internal Transfers" text, "Total Transfers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the transfers in for Hungary?
SELECT "Transfers In" FROM table_78999 WHERE "Country" = 'hungary'
wikisql
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 t_kc21.MED_CLINIC_ID, t_kc21.PERSON_ID, t_kc21.PERSON_NM, t_kc21.IDENTITY_CARD, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '03425240816')
css
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, da...
atis
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 = "BOWEL OBSTRUCTION" AND demographic.age < "82"
mimicsql_data
CREATE TABLE table_name_16 ( surname VARCHAR, first VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Michael's surname?
SELECT surname FROM table_name_16 WHERE first = "michael"
sql_create_context
CREATE TABLE table_64920 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which rowers represented the country of portugal?
SELECT "Rowers" FROM table_64920 WHERE "Country" = 'portugal'
wikisql
CREATE TABLE table_name_12 ( points VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of points associated with 165 laps?
SELECT points FROM table_name_12 WHERE laps = 165
sql_create_context
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.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9861939' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM HAVING AVG(gwyjzb.PERSON_AGE) < 3 UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHE...
css
CREATE TABLE member ( name VARCHAR, address VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give me the names of members whose address is in Harford or Waterbury.
SELECT name FROM member WHERE address = 'Harford' OR address = 'Waterbury'
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "79" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'THEORY' AND COURSE_0.numbe...
advising
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.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age >= "47"
mimicsql_data
CREATE TABLE table_name_68 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date when Canada played?
SELECT date FROM table_name_68 WHERE opponent = "canada"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
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 = 'therapeutic antibacterials - fourth generati...
eicu
CREATE TABLE table_name_14 ( condition VARCHAR, partial_thromboplastin_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the condition with partial thromboplastin time of prolonged or unaffected
SELECT condition FROM table_name_14 WHERE partial_thromboplastin_time = "prolonged or unaffected"
sql_create_context
CREATE TABLE table_74674 ( "Institution" text, "Nickname" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which college's enrollment is less than 1,000?
SELECT "Institution" FROM table_74674 WHERE "Enrollment" < '1,000'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semes...
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
advising
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-178583')) AND vitalperiodic.temperature < 33.0 ...
eicu
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-185446'))
eicu
CREATE TABLE table_name_73 ( medal VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the medal named fatuma roba category:articles with hcards for?
SELECT medal FROM table_name_73 WHERE name = "fatuma roba category:articles with hcards"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "5651"
mimicsql_data
CREATE TABLE table_name_61 ( bronze INTEGER, nation VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the united states won a total number of medals larger than 25, what was the lowest amount of Bronze medals won?
SELECT MIN(bronze) FROM table_name_61 WHERE nation = "united states" AND total > 25
sql_create_context
CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptroller text, attorney_general text, us_senate text ) CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE el...
SELECT COUNT(*) FROM county
spider