instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE county_public_safety ( Crime_rate VARCHAR, Police_officers VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the crime rates of counties in ascending order of number of police officers.
SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers
sql_create_context
CREATE TABLE table_1532779_1 ( muslim___percentage_of_total_population_ VARCHAR, population_of_england_and_wales_000 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the muslim percentage of the 49634 population of england and wales 000?
SELECT muslim___percentage_of_total_population_ FROM table_1532779_1 WHERE population_of_england_and_wales_000 = 49634
sql_create_context
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Nitroglycerin SL"
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 d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id nu...
SELECT COUNT(*) 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 = 2238)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tubes right p...
mimic_iii
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "48" AND demographic.admityear < "2138"
mimicsql_data
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varc...
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 767 AND instructor.name LIKE '%Valerie Laken%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_i...
advising
CREATE TABLE table_75218 ( "Home Run" real, "Game" real, "Date" text, "Inning" text, "Location" text, "Opposing Pitcher" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On June 17 in Tiger stadium, what was the average home run?
SELECT AVG("Home Run") FROM table_75218 WHERE "Location" = 'tiger stadium' AND "Date" = 'june 17'
wikisql
CREATE TABLE table_27733909_10 ( high_assists VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the highest assists in game 75?
SELECT high_assists FROM table_27733909_10 WHERE game = 75
sql_create_context
CREATE TABLE table_37286 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least amount of points when there w...
SELECT MIN("Points") FROM table_37286 WHERE "Lost" < '4' AND "Against" < '16'
wikisql
CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(10), order_date DATETIME ) CREATE TABLE Product_Suppliers (...
SELECT product_name, product_price FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 ORDER BY product_name DESC
nvbench
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod 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, last_wardid number, ...
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24330) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND STRFTIME('%y-%m', labevents.charttime) = '2104-04' GROUP BY...
mimic_iii
CREATE TABLE table_name_52 ( ship VARCHAR, captain VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the ship for lieutenant montagu verling
SELECT ship FROM table_name_52 WHERE captain = "lieutenant montagu verling"
sql_create_context
CREATE TABLE table_name_85 ( draw VARCHAR, span VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What draw has a Span of 1987-1999?
SELECT draw FROM table_name_85 WHERE span = "1987-1999"
sql_create_context
CREATE TABLE table_name_96 ( opponents_in_final VARCHAR, partner VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponents in Final, when Partner is 'Jill Hetherington', and when Year is after 1988?
SELECT opponents_in_final FROM table_name_96 WHERE partner = "jill hetherington" AND year > 1988
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CR...
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8005) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1)) - (...
mimic_iii
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 patient ( uniquep...
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 = '002-44624' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id n...
SELECT admissions.age FROM admissions WHERE admissions.subject_id = 61751 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code te...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
mimic_iii
CREATE TABLE table_name_5 ( away_team VARCHAR, crowd INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the crowd was greater than 19,498 who was the away team?
SELECT away_team FROM table_name_5 WHERE crowd > 19 OFFSET 498
sql_create_context
CREATE TABLE table_name_39 ( lens_35mmequiv__zoom VARCHAR, _aperture VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the lens zoom for aperture of model s2600
SELECT lens_35mmequiv__zoom, _aperture FROM table_name_39 WHERE model = "s2600"
sql_create_context
CREATE TABLE table_76525 ( "Season" text, "Skip" text, "Third" text, "Second" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Skip has a Season of 2002 03?
SELECT "Skip" FROM table_76525 WHERE "Season" = '2002–03'
wikisql
CREATE TABLE table_name_57 ( district VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the district of wallasey
SELECT district FROM table_name_57 WHERE name = "wallasey"
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "13" AND lab.label = "Creatinine"
mimicsql_data
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.short_title = "Opn/oth rep aort vlv-tis"
mimicsql_data
CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text ) -- Using valid SQLite, answer the following questions fo...
SELECT Snatch, Clean_Jerk FROM body_builder
nvbench
CREATE TABLE table_56283 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the episode with a production code of ...
SELECT "Title" FROM table_56283 WHERE "Production code" = 'k1504'
wikisql
CREATE TABLE table_203_758 ( id number, "no." number, "dub no." number, "english dubbed title / english subbed title\noriginal japanese title" text, "original air date" text, "english air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what...
SELECT COUNT("english dubbed title / english subbed title\noriginal japanese title") FROM table_203_758
squall
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'C89.828' AND jyjgzbb.JCZBMC = '胸腹水白蛋白(白...
css
CREATE TABLE table_33435 ( "Round" real, "Pick" real, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did the player picked for the linebacker position play in college?
SELECT "College" FROM table_33435 WHERE "Position" = 'linebacker'
wikisql
CREATE TABLE table_62084 ( "Country" text, "Season" text, "Victories" real, "Downhill" text, "Super G" text, "Giant Slalom" real, "Slalom" text, "Combined" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Slalom was Switzerland in?
SELECT "Slalom" FROM table_62084 WHERE "Country" = 'switzerland'
wikisql
CREATE TABLE table_6096 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the series score when st. louis was away on april 18?
SELECT "Series" FROM table_6096 WHERE "Visitor" = 'st. louis' AND "Date" = 'april 18'
wikisql
CREATE TABLE table_29665 ( "Episode Air Date" text, "Audition City" text, "Audition Date" text, "Audition Venue" text, "Guest Fourth Judge" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episode air dates are there for auditioning city Rio ...
SELECT COUNT("Episode Air Date") FROM table_29665 WHERE "Audition City" = 'Rio de Janeiro'
wikisql
CREATE TABLE table_29166 ( "Chambering" text, "P1 diameter (mm)" text, "A external (cm 2 )" text, "P max ( bar )" real, "F bolt ( kgf )" real, "F bolt" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the p max (bar) in the pistol where th...
SELECT MAX("P max ( bar )") FROM table_29166 WHERE "Chambering" = '.45 ACP'
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 diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Paul Edwards"
mimicsql_data
CREATE TABLE table_65305 ( "World record" text, "Snatch" text, "Chen Yanqing ( CHN )" text, "111kg" text, "Doha , Qatar" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Doha, Qatar when the snatch is total?
SELECT "Doha , Qatar" FROM table_65305 WHERE "Snatch" = 'total'
wikisql
CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE certificate ( eid number, aid number ) ...
SELECT AVG(price) FROM flight WHERE origin = "Los Angeles" AND destination = "Honolulu"
spider
CREATE TABLE table_197638_6 ( player VARCHAR, french_open VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the French Open in 1999?
SELECT player FROM table_197638_6 WHERE french_open = 1999
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3677 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)
mimic_iii
CREATE TABLE table_204_780 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- tell me the number of times he placed 4th .
SELECT COUNT(*) FROM table_204_780 WHERE "position" = 4
squall
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( ...
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ROMLING' AND course.number = 993 AND semester.semester_id = course_offering.semester ORDER BY semester.year DESC LIMIT 1
advising
CREATE TABLE table_53780 ( "Season" real, "Premier" text, "Runner Up" text, "Score" text, "Venue" text, "Attendance" real, "Margin" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is the earliest season at waverley park, a Score of 15.12...
SELECT MIN("Season") FROM table_53780 WHERE "Venue" = 'waverley park' AND "Score" = '15.12 (102) – 9.14 (68)' AND "Margin" > '34'
wikisql
CREATE TABLE table_17420 ( "Year" text, "Communications and Corporate Affairs" text, "Human Resources & Operations" text, "Local Affairs" text, "Academic & University Affairs" text, "External Affairs" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Year" FROM table_17420 WHERE "Communications and Corporate Affairs" = 'Jeff Rotman'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "58" AND lab.label = "RBC, CSF"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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 = "Personal history of colonic polyps" AND prescriptions.route = "NG"
mimicsql_data
CREATE TABLE table_38037 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game with 96 points?
SELECT "Score" FROM table_38037 WHERE "Points" = '96'
wikisql
CREATE TABLE table_14330096_4 ( title VARCHAR, director VARCHAR, writer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which episodes have Patrick Lau as the director and Lisa Holdsworth as the writer?
SELECT title FROM table_14330096_4 WHERE director = "Patrick Lau" AND writer = "Lisa Holdsworth"
sql_create_context
CREATE TABLE table_60908 ( "Shooter" text, "Event" text, "Rank points" text, "Score points" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the shooter with a total of 25?
SELECT "Shooter" FROM table_60908 WHERE "Total" = '25'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT demographic.gender, demographic.religion FROM demographic WHERE demographic.subject_id = "1121"
mimicsql_data
CREATE TABLE table_name_83 ( ground VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On which ground did the team play Aston Villa?
SELECT ground FROM table_name_83 WHERE opponent = "aston villa"
sql_create_context
CREATE TABLE table_26131768_4 ( district VARCHAR, residence VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which district is the residence Dublin?
SELECT district FROM table_26131768_4 WHERE residence = "Dublin"
sql_create_context
CREATE TABLE table_71863 ( "First game" real, "Played" real, "Drawn" real, "Lost" real, "Percentage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games were played by a team that won 0.00% of their games and 0 draws?
SELECT SUM("Played") FROM table_71863 WHERE "Percentage" = '0.00%' AND "Drawn" < '0'
wikisql
CREATE TABLE table_54959 ( "Game" text, "Date" text, "Opponent" text, "Result" text, "Rams points" real, "Opponents" real, "Record" text, "Venue" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Game did Rams...
SELECT "Game" FROM table_54959 WHERE "Rams points" = '0'
wikisql
CREATE TABLE table_24491017_1 ( team VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team was he on when he finished in 11th position?
SELECT team FROM table_24491017_1 WHERE position = "11th"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "BLADDER CANCER/SDA"
mimicsql_data
CREATE TABLE table_34047 ( "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. -- What is the Callsign with an Area of tamworth and frequency of 0 88.9?
SELECT "Callsign" FROM table_34047 WHERE "Area served" = 'tamworth' AND "Frequency" = '0 88.9'
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 airline ( ...
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 (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 24 AND date_day.month_number = 5 A...
atis
CREATE TABLE table_name_74 ( time VARCHAR, opponent VARCHAR, res VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time of the match with a win result, more than 2 rounds, and Makoto Ishikawa as the opponent?
SELECT time FROM table_name_74 WHERE res = "win" AND round > 2 AND opponent = "makoto ishikawa"
sql_create_context
CREATE TABLE table_name_75 ( player VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player was drafted number 10?
SELECT player FROM table_name_75 WHERE pick = 10
sql_create_context
CREATE TABLE table_name_14 ( finalist VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the finalist for the tournament in berlin?
SELECT finalist FROM table_name_14 WHERE tournament = "berlin"
sql_create_context
CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, unit_of_measure text ) CREATE TABLE product_characteristics ( product_id number, characteristic_id number, product_characteristic_value text ) CREATE TABLE ref_colors ( color_code text, ...
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_175980_2 ( premiere VARCHAR, finale VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What premieres had a finale on May 25, 2004?
SELECT premiere FROM table_175980_2 WHERE finale = "May 25, 2004"
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "REPLACE"
mimicsql_data
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, O...
SELECT COALESCE(post.Title, parent.Title) AS QuestionTitle, COUNT(*) AS Edits, post.PostTypeId AS PostType, @UrlBase + CAST(h.PostId AS TEXT(25)) + '|' + CAST(h.PostId AS TEXT(25)) AS PostId FROM Posts AS post INNER JOIN PostHistory AS h ON post.PostTypeId IN (1, 2) AND post.Id = h.PostId INNER JOIN Posts AS parent ON ...
sede
CREATE TABLE table_22073745_1 ( languages VARCHAR, film_title_used_in_nomination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many languages is refractaire as the film title used in nomination?
SELECT COUNT(languages) FROM table_22073745_1 WHERE film_title_used_in_nomination = "Refractaire"
sql_create_context
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '1075351' AND JZKSRQ BETWEEN '2006-10-23' AND '2018-01-09' AND ZZBZ > 0
css
CREATE TABLE table_75813 ( "Chord" text, "Root" text, "Major third" text, "Perfect fifth" text, "Minor seventh" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Chord with a Major that is third of e?
SELECT "Chord" FROM table_75813 WHERE "Major third" = 'e'
wikisql
CREATE TABLE table_203_377 ( 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. -- total number of bronze medals nigeria earned ?
SELECT "bronze" FROM table_203_377 WHERE "nation" = 'nigeria'
squall
CREATE TABLE table_59202 ( "Year" real, "Lok Sabha" text, "Members of Parliament" text, "Party Won" text, "Winner's % votes" text, "Trailing Party" text, "Trailing Party % votes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the low...
SELECT MIN("Year") FROM table_59202 WHERE "Lok Sabha" = '4th lok sabha'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "1" AND procedures.long_title = "Biopsy of bone marrow"
mimicsql_data
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskResults ( Id number, Review...
SELECT SUM(UpVotes) AS upv, SUM(DownVotes) AS downv FROM Users
sede
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number...
SELECT AVG(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-69150')) AND NOT vitalperiodic.respiration IS ...
eicu
CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Total real ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Scor...
SELECT T1.name, COUNT(T1.name) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID GROUP BY T1.name
nvbench
CREATE TABLE table_1233 ( "Element" text, "Nuclide" text, "Z ( p )" real, "N ( n )" real, "isotopic mass ( u )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mass of the element with a nuclide that is 169 tm?
SELECT "isotopic mass ( u )" FROM table_1233 WHERE "Nuclide" = '169 Tm'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM...
css
CREATE TABLE table_8474 ( "South or west terminus" text, "North or east terminus" text, "First year" real, "Final year" real, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average First year that has a Notes of replaced by us 12...
SELECT AVG("First year") FROM table_8474 WHERE "Notes" = 'replaced by us 12 when i-94 replaced us 12' AND "Final year" > '1961'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, ...
SELECT chartevents.charttime 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 = 32606)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra...
mimic_iii
CREATE TABLE table_name_88 ( opponent_in_the_final VARCHAR, partnering VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent in the final has a Partnering of graydon oliver?
SELECT opponent_in_the_final FROM table_name_88 WHERE partnering = "graydon oliver"
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.ethnicity = "BLACK/HAITIAN" AND demographic.diagnosis = "ANGIOEDEMA"
mimicsql_data
CREATE TABLE table_name_48 ( finishes INTEGER, wins VARCHAR, points VARCHAR, stage_wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest finishes when the points is less than 337, the stage wins is 2 and the wins is more than 0?
SELECT MAX(finishes) FROM table_name_48 WHERE points < 337 AND stage_wins = 2 AND wins > 0
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.QTY * t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '08024624019'
css
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
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 = '72...
css
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 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 = '49963274' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE table_3095 ( "Season" text, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least ...
SELECT MIN("Wins") FROM table_3095
wikisql
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.MED_ORG_DEPT_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '55063958449' UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.MED_ORG_DEPT_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '55063958449'
css
CREATE TABLE table_16013 ( "Nomination" text, "Actors Name" text, "Film Name" text, "Director" text, "Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the actor's name for best debut?
SELECT "Actors Name" FROM table_16013 WHERE "Nomination" = 'Best Debut'
wikisql
CREATE TABLE table_24837750_1 ( turbine_manufacturer VARCHAR, installed_capacity__mw_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many turbine manufacturers installed a capacity of 189 MW?
SELECT COUNT(turbine_manufacturer) FROM table_24837750_1 WHERE installed_capacity__mw_ = "189"
sql_create_context
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM 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 = '韩嘉容'
css
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, ...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54894) AND prescriptions.drug = 'spironolactone' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-5 year')
mimic_iii
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 intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-1746') AND NOT patient.unitdischargetime IS NULL ORDER B...
eicu
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 's/p thoracoscopic procedure' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105' GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'NERS' AND COURSE_0.number = 518 AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'NERS' AND COURSE_1.number = 299
advising
CREATE TABLE gas_station ( station_id number, open_year number, location text, manager_name text, vice_manager_name text, representative_name text ) CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion ...
SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_31 ( host_team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the host team on October 4?
SELECT host_team FROM table_name_31 WHERE date = "october 4"
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
SELECT EMAIL, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL
nvbench
CREATE TABLE table_28562675_3 ( austria VARCHAR, netherlands VARCHAR, belgium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the team from Austria when the Netherlands sent Brunssum/Schinnen LL Brunssum and Belgium sent Shape and Waterloo LL Bru...
SELECT austria FROM table_28562675_3 WHERE netherlands = "Brunssum/Schinnen LL Brunssum" AND belgium = "SHAPE and Waterloo LL Brussels"
sql_create_context
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course...
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.number = 203 AND c...
advising
CREATE TABLE table_14700336_1 ( revenue__millions_ VARCHAR, revenue_per_capita VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many numbers were recorded under revenue when revenue per capita was $6,126?
SELECT COUNT(revenue__millions_) FROM table_14700336_1 WHERE revenue_per_capita = "$6,126"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT * FROM VoteTypes
sede
CREATE TABLE table_20418 ( "Episode Number" real, "Air Date" text, "Guest Host" text, "Musical Guest (Song performed)" text, "Who knows the most about the guest host? panelists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most episode nu...
SELECT MAX("Episode Number") FROM table_20418 WHERE "Air Date" = '6 January 2006'
wikisql
CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE instructor ( id text, name text, dept_name text, salary number ) CREATE TABLE takes ( id text, course_id text, sec_id text, semester text, year number, grade text ) CREATE TABLE time_slot ( time_sl...
SELECT name FROM instructor WHERE NOT id IN (SELECT id FROM teaches)
spider