instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE table_12413 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 7:30 has tout le monde en parle as the 8:00?
SELECT "7:30" FROM table_12413 WHERE "8:00" = 'tout le monde en parle'
wikisql
CREATE TABLE table_31388 ( "Season" text, "Season premiere" text, "Season finale" text, "TV season" text, "Ranking" text, "Viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season was the finale that aired on May 23, 200...
SELECT "TV season" FROM table_31388 WHERE "Season finale" = 'May 23, 2004'
wikisql
CREATE TABLE table_68462 ( "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. -- Who in series 5 corresponds to Deborah Meaden in series 3?
SELECT "Series 5" FROM table_68462 WHERE "Series 3" = 'deborah meaden'
wikisql
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.YLJGDM 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 AND per...
css
CREATE TABLE table_name_45 ( location_attendance VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance during the game against Philadelphia?
SELECT location_attendance FROM table_name_45 WHERE team = "philadelphia"
sql_create_context
CREATE TABLE table_62951 ( "Team" text, "Tries for" real, "Tries against" real, "Try diff" text, "Points for" real, "Points against" real, "Points diff" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points for has Points against small...
SELECT MIN("Points for") FROM table_62951 WHERE "Points against" < '93' AND "Tries for" > '25'
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
SELECT COUNT(*) 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 = 1269)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'br milk fs ng...
mimic_iii
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "29" AND procedures.long_title = "Exteriorization of small intestine"
mimicsql_data
CREATE TABLE table_name_94 ( col__m_ INTEGER, prominence__m_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum Col (m) when 3,046 is the Prominence (m)?
SELECT MAX(col__m_) FROM table_name_94 WHERE prominence__m_ = 3 OFFSET 046
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, total') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97330 AND admi...
mimic_iii
CREATE TABLE table_21398 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years was the original title was (swopnodanay)?
SELECT COUNT("Year (Ceremony)") FROM table_21398 WHERE "Original title" = 'স্বপ্নডানায় (Swopnodanay)'
wikisql
CREATE TABLE table_train_252 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "fasting_plasma_glucose_fpg" float, "hemoglobin_a1c_hba1c" float, "hba1c" float, "serum_creatinine" float, "metformin" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the f...
SELECT * FROM table_train_252 WHERE pregnancy_or_lactation = 1 AND (age >= 18 AND age <= 40)
criteria2sql
CREATE TABLE table_59773 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What episode has 7.8 million viewers?
SELECT "Episode" FROM table_59773 WHERE "Viewers (in millions)" = '7.8'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'neutropenia nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions W...
mimic_iii
CREATE TABLE table_name_51 ( driver VARCHAR, date VARCHAR, position VARCHAR, team VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what driver has a team of officine alfieri maserati and belongs to the class of non-championship f2 an...
SELECT driver FROM table_name_51 WHERE team = "officine alfieri maserati" AND class = "non-championship f2" AND position = 2 AND date = "9/1952"
sql_create_context
CREATE TABLE ref_budget_codes ( budget_type_code text, budget_type_description text ) CREATE TABLE documents_with_expenses ( document_id number, budget_type_code text, document_details text ) CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_t...
SELECT COUNT(*) FROM documents_with_expenses
spider
CREATE TABLE table_55395 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time or retired time for timo glock with under 70 laps and a grid number greater than 1...
SELECT "Time/Retired" FROM table_55395 WHERE "Laps" < '70' AND "Grid" > '15' AND "Driver" = 'timo glock'
wikisql
CREATE TABLE table_49108 ( "Week" real, "Date" text, "Opponent" text, "Score" text, "Result" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent, when Result is Win, and when Date is Aug 7?
SELECT "Opponent" FROM table_49108 WHERE "Result" = 'win' AND "Date" = 'aug 7'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2200" AND diagnoses.icd9_code = "E8791"
mimicsql_data
CREATE TABLE table_37346 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance of the game on 2007-04-07 with the Wa...
SELECT "Attendance" FROM table_37346 WHERE "Visitor" = 'warriors' AND "Date" = '2007-04-07'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY School_ID DESC
nvbench
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number...
SELECT AVG(T1.age) FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = secretary_vote WHERE T1.sex = "F" AND T2.election_cycle = "Spring"
spider
CREATE TABLE table_name_52 ( poles INTEGER, fastest_laps INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of poles when the fastest laps are less than 0?
SELECT MIN(poles) FROM table_name_52 WHERE fastest_laps < 0
sql_create_context
CREATE TABLE table_203_118 ( id number, "game" number, "date" text, "opponent" text, "location" text, "score" text, "ot" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total amount of g...
SELECT COUNT(*) FROM table_203_118 WHERE "score" - "score" > 2
squall
CREATE TABLE table_name_91 ( position VARCHAR, pick__number VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does a Keith Shologan, who was picked higher than 6, play?
SELECT position FROM table_name_91 WHERE pick__number < 6 AND player = "keith shologan"
sql_create_context
CREATE TABLE table_41313 ( "Album" text, "Release date" text, "Label" text, "Format" text, "Covered Song" text, "Original Song" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the Covered Song when the Album shows cover versio...
SELECT "Covered Song" FROM table_41313 WHERE "Album" = 'cover version iii'
wikisql
CREATE TABLE Draft_Copies ( document_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many draft copies does the document with id 2 have?
SELECT COUNT(*) FROM Draft_Copies WHERE document_id = 2
sql_create_context
CREATE TABLE table_22905641_2 ( race_1_winner VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the race 1 winner at the race held at Winton Motor Raceway?
SELECT race_1_winner FROM table_22905641_2 WHERE circuit = "Winton Motor Raceway"
sql_create_context
CREATE TABLE table_name_43 ( season INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most recent season with a date of 27 October 1957?
SELECT MAX(season) FROM table_name_43 WHERE date = "27 october 1957"
sql_create_context
CREATE TABLE table_name_26 ( conference VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What conference has the Wichita State school?
SELECT conference FROM table_name_26 WHERE school = "wichita state"
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 WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND demographic.admityear < "2203"
mimicsql_data
CREATE TABLE table_203_720 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the 1987 syracuse orangemen football team scored their largest number of points in a game c...
SELECT "opponent#" FROM table_203_720 WHERE "date" = 'october 24'
squall
CREATE TABLE table_17323092_8 ( date VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What dates did Chris Bosh (18) score the high points?
SELECT date FROM table_17323092_8 WHERE high_points = "Chris Bosh (18)"
sql_create_context
CREATE TABLE table_73778 ( "Driver Unit Model No." text, "Release Year" real, "Output Voltage (RMS)" text, "Inputs" text, "Outputs" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many outputs are there for solid state, battery ...
SELECT COUNT("Outputs") FROM table_73778 WHERE "Notes" = 'Solid state, battery operated for portable use'
wikisql
CREATE TABLE table_name_20 ( attendance VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance at the game when the record was 35-46?
SELECT attendance FROM table_name_20 WHERE record = "35-46"
sql_create_context
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id ...
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 course, course_offering, semester WHERE course.course_id = course_offe...
advising
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, value...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
mimic_iii
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "85" AND lab.label = "MCV"
mimicsql_data
CREATE TABLE table_616 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Area" real, "Population" real, "Density" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people live in the district who's capital i...
SELECT "Population" FROM table_616 WHERE "Pinyin" = 'Héngfēng Xiàn'
wikisql
CREATE TABLE table_58783 ( "Name" text, "Bodyweight" real, "Snatch" text, "Clean & Jerk" text, "Total (kg)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total bodyweight of everyone that has a Snatch of 153.0?
SELECT SUM("Bodyweight") FROM table_58783 WHERE "Snatch" = '153.0'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "WIDOWED" AND diagnoses.short_title = "Systolic hrt failure NOS"
mimicsql_data
CREATE TABLE table_69780 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "10:00" text, "10:30" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- for the 7:30 of access hollywood what is the 10:00?
SELECT "10:00" FROM table_69780 WHERE "7:30" = 'access hollywood'
wikisql
CREATE TABLE table_name_8 ( gold INTEGER, nation VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What amount of Gold does Russia have and have a rank larger than 1?
SELECT SUM(gold) FROM table_name_8 WHERE nation = "russia" AND rank > 1
sql_create_context
CREATE TABLE table_27675 ( "Position" text, "Number" real, "Horse" text, "Jockey" text, "Age" real, "Handicap" text, "SP" text, "Distance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who isthe jockey in 10th position?
SELECT "Jockey" FROM table_27675 WHERE "Position" = '10th'
wikisql
CREATE TABLE table_47323 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE TOTAL NUMBER WITH A ROUND BIGGER THAN 7 AND PICK OF 21?
SELECT COUNT("Overall") FROM table_47323 WHERE "Round" > '7' AND "Pick" = '21'
wikisql
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 locations ( LOCATION_ID decimal(4,0...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'dx ultrasound-heart')) AND STRFTIME('%y', cost.chargetime...
mimic_iii
CREATE TABLE table_24099916_1 ( model__list_ VARCHAR, tdp VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the model of the processor with a 5.5 w TDP?
SELECT model__list_ FROM table_24099916_1 WHERE tdp = "5.5 W"
sql_create_context
CREATE TABLE table_name_45 ( rank INTEGER, nation VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of a rank whose nation is West Germany and has bronze larger than 0?
SELECT SUM(rank) FROM table_name_45 WHERE nation = "west germany" AND bronze > 0
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number...
SELECT a.Id AS "post_link", a.Id, q.Title, a.CreationDate, a.Score, q.ViewCount AS "views", CASE WHEN a.Id = q.AcceptedAnswerId THEN 1 ELSE 0 END AS Accepted, q.Tags FROM Posts AS a LEFT JOIN Posts AS q ON q.Id = a.ParentId WHERE a.PostTypeId = 2 AND a.OwnerUserId = '##UserId##' AND q.Tags LIKE '%<##Tag##>%' AND YEAR(a...
sede
CREATE TABLE table_70781 ( "Name" text, "Born" text, "Age on mission" real, "Mission" text, "Mission dates" text, "Service" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest age of an astronaut named Stu Roosa?
SELECT MIN("Age on mission") FROM table_70781 WHERE "Name" = 'stu roosa'
wikisql
CREATE TABLE table_name_71 ( leading_lady VARCHAR, studio VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the leading lady for Uni studio and Frank Strayer?
SELECT leading_lady FROM table_name_71 WHERE studio = "uni" AND director = "frank strayer"
sql_create_context
CREATE TABLE table_29822 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who ha...
SELECT "High assists" FROM table_29822 WHERE "Game" = '78'
wikisql
CREATE TABLE table_7315 ( "Tournament" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "Career W-L" text ) -- Using valid SQLite, answer the followi...
SELECT "2006" FROM table_7315 WHERE "2009" = '0' AND "Tournament" = 'runner-ups'
wikisql
CREATE TABLE table_53707 ( "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. -- In which venue did a home team score 15.5 (95)?
SELECT "Venue" FROM table_53707 WHERE "Home team score" = '15.5 (95)'
wikisql
CREATE TABLE team_half ( year number, league_id text, team_id text, half number, div_id text, div_win text, rank number, g number, w number, l number ) CREATE TABLE player_award ( player_id text, award_id text, year number, league_id text, tie text, notes...
SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid
spider
CREATE TABLE table_10 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different nationalities do the players of New Jersey Dev...
SELECT COUNT("Nationality") FROM table_10 WHERE "NHL team" = 'New Jersey Devils'
wikisql
CREATE TABLE table_201_42 ( id number, "year" text, "title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times did daniels host saturday night live ?
SELECT COUNT(*) FROM table_201_42 WHERE "title" = 'saturday night live' AND "role" = 'host'
squall
CREATE TABLE table_23399481_4 ( title VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the episode/s written by Michael Gans & Richard Register?
SELECT title FROM table_23399481_4 WHERE written_by = "Michael Gans & Richard Register"
sql_create_context
CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_date time, available_yn others ) CREATE TABLE apartment_bookings ( apt_booking_id number, apt_id number, guest_id number, booking_status_code text, booking_start_date time, booking_end_date time ) CREA...
SELECT SUM(T2.room_count) FROM apartment_facilities AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = "Gym"
spider
CREATE TABLE table_name_6 ( player VARCHAR, team VARCHAR, pick VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a Pick smaller than 11, and a Position of rhp, and a Team of new york mets?
SELECT player FROM table_name_6 WHERE pick < 11 AND position = "rhp" AND team = "new york mets"
sql_create_context
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 demographic.dob, lab.itemid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating number, languages text, releasedate time, resolution number ) CREATE TABL...
SELECT song_name FROM song ORDER BY resolution
spider
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildin...
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code
nvbench
CREATE TABLE table_name_66 ( chinese__traditional_ VARCHAR, chinese__simplified_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What would be the traditional Chinese name tat is simplified as ?
SELECT chinese__traditional_ FROM table_name_66 WHERE chinese__simplified_ = "崇拜"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Chr airway obstruct NEC"
mimicsql_data
CREATE TABLE table_31418 ( "Official name" text, "INE code" real, "Name in Spanish" text, "Name in Basque" text, "Population (2007)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the official name of the municipality whose name in Spanish i...
SELECT "Official name" FROM table_31418 WHERE "Name in Spanish" = 'Cripán'
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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime ...
SELECT MAX(outputevents.value) 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 = 73155)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'uri...
mimic_iii
CREATE TABLE table_41302 ( "Round #" real, "Pick #" real, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average round number with wide receiver as position and Clark University as the college an...
SELECT AVG("Round #") FROM table_41302 WHERE "Position" = 'wide receiver' AND "College" = 'clark university' AND "Pick #" > '166'
wikisql
CREATE TABLE table_name_24 ( round INTEGER, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round in which a player was picked for the Center position?
SELECT MAX(round) FROM table_name_24 WHERE position = "center"
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, ...
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 = 'DENVER' AND date_day.day_number = 23 AND date_day.month_number = 11 AND d...
atis
CREATE TABLE table_11585313_1 ( name VARCHAR, date_of_death† VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the person whose date of death is 01-04-1954?
SELECT name FROM table_11585313_1 WHERE date_of_death† = "01-04-1954"
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'meth res pneu d/t staph') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admi...
mimic_iii
CREATE TABLE table_52894 ( "Runner" text, "Country" text, "5K Wins" real, "10K Wins" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many 5K wins did Emily Chebet, who had more than 2 total, have?
SELECT SUM("5K Wins") FROM table_52894 WHERE "Runner" = 'emily chebet' AND "Total" > '2'
wikisql
CREATE TABLE table_59490 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real ) -- Using valid SQLite, answer the following questi...
SELECT AVG("League Goals") FROM table_59490 WHERE "FA Cup Goals" = '0' AND "Position" = 'mf' AND "League Cup Apps" = '0' AND "Name" = 'ben thornley'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "45" AND diagnoses.short_title = "Poison-analgesics"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2176" AND procedures.long_title = "Coronary arteriography using a single catheter"
mimicsql_data
CREATE TABLE table_name_12 ( genre VARCHAR, original_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Genre for Malina (ger.-aus.-fr.), an Original Title?
SELECT genre FROM table_name_12 WHERE original_title = "malina (ger.-aus.-fr.)"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_lo...
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 = 'WASHINGTON' AND date_day.day_number = 21 AND date_day.month_number = 2 AN...
atis
CREATE TABLE table_name_1 ( engine VARCHAR, rounds VARCHAR, driver VARCHAR, tyres VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine was used during the race driven by Jan Lammers using a chassis of d3 d4, making a tyre o...
SELECT engine FROM table_name_1 WHERE tyres = "g" AND chassis = "d3 d4" AND driver = "jan lammers" AND rounds = "4-6"
sql_create_context
CREATE TABLE table_name_48 ( no_vote VARCHAR, state VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many no votes did North Dakota have?
SELECT no_vote FROM table_name_48 WHERE state = "north dakota"
sql_create_context
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Student ( StuID INTEGER, ...
SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex
nvbench
CREATE TABLE table_name_45 ( losses VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Losses have a Name of blair kiel?
SELECT COUNT(losses) FROM table_name_45 WHERE name = "blair kiel"
sql_create_context
CREATE TABLE table_name_54 ( losses VARCHAR, byes INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Of the teams that had more than 0 byes, what was the total number of losses?
SELECT COUNT(losses) FROM table_name_54 WHERE byes < 0
sql_create_context
CREATE TABLE table_203_701 ( id number, "#" number, "title" text, "featured guest(s)" text, "producer(s)" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many titles are on the album ?
SELECT COUNT("title") FROM table_203_701
squall
CREATE TABLE table_45747 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance when the score was 88-98?
SELECT "Attendance" FROM table_45747 WHERE "Score" = '88-98'
wikisql
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TA...
SELECT YR_WK, COUNT(*) AS NumActiveExperts FROM (SELECT (TIME_TO_STR(p.CreationDate, '%y') + (TIME_TO_STR(p.CreationDate, '%W') - 1) / 52.0) AS YR_WK, u.Id AS UID, COUNT(*) AS NumAnswers FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id AND p.PostTypeId = 2 AND p.Score > 0 GROUP BY (TIME_TO_STR(p.CreationDa...
sede
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS A...
atis
CREATE TABLE table_70000 ( "Tournament" text, "Wins" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the lowest number of cuts made while the win was less than 0?
SELECT MIN("Cuts made") FROM table_70000 WHERE "Wins" < '0'
wikisql
CREATE TABLE table_9627 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par for Leonard Thompson from the United States with a place of T6?
SELECT "To par" FROM table_9627 WHERE "Place" = 't6' AND "Country" = 'united states' AND "Player" = 'leonard thompson'
wikisql
CREATE TABLE table_74154 ( "Product Name" text, "Form Factor" text, "Storage Medium" text, "Max Usable Capacity (GB)" real, "Speed ( IOPS )" real, "Latency (microseconds)" real, "Bandwidth (GB/s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Form Factor" FROM table_74154 WHERE "Product Name" = 'RamSan-630'
wikisql
CREATE TABLE table_name_8 ( launches_to_date VARCHAR, version VARCHAR, ccbs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total Launches to date with a Version of 541, and CCBs smaller than 1?
SELECT COUNT(launches_to_date) FROM table_name_8 WHERE version = "541" AND ccbs < 1
sql_create_context
CREATE TABLE table_14342367_13 ( class VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was George W. Gregory's class?
SELECT class FROM table_14342367_13 WHERE player = "George W. Gregory"
sql_create_context
CREATE TABLE table_name_77 ( pick__number INTEGER, round VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the pick numbers where the player was picked in round 5 and overall pick number was greater than 159?
SELECT SUM(pick__number) FROM table_name_77 WHERE round = 5 AND overall > 159
sql_create_context
CREATE TABLE table_38611 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "TV Time" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game Site has a Date of october 17, 1...
SELECT "Game Site" FROM table_38611 WHERE "Date" = 'october 17, 1999'
wikisql
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "79"
mimicsql_data
CREATE TABLE table_72607 ( "Episode #" text, "Country" text, "City" text, "Martial Art/Style" text, "Masters" text, "Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many masters fought using a boxing style?
SELECT COUNT("Masters") FROM table_72607 WHERE "Martial Art/Style" = 'Boxing'
wikisql
CREATE TABLE table_62684 ( "Main contestant" text, "Co-contestant (Yaar vs. Pyaar)" text, "Date performed" text, "Scores by each individual judge" text, "Total score/week" text, "Position" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Position" FROM table_62684 WHERE "Main contestant" = 'vishal singh' AND "Scores by each individual judge" = '1 + 7 + 5 = 13'
wikisql