instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_16 ( matches_as_champion INTEGER, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Matches has champion Rank of 5?
SELECT MAX(matches_as_champion) FROM table_name_16 WHERE rank = 5
sql_create_context
CREATE TABLE table_28399 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Founding Religious Affiliation" text, "Enrollment" real, "Joined" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the enrollment at the ...
SELECT "Enrollment" FROM table_28399 WHERE "Location" = 'New London, Connecticut'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TAB...
SELECT d.RANK AS RANK_INDIA FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS RANK FROM Users WHERE LOWER(Location) LIKE '%india%') AS d WHERE d.Id = 1288725
sede
CREATE TABLE table_name_62 ( laps INTEGER, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of laps with a time/retired of +38.426?
SELECT MIN(laps) FROM table_name_62 WHERE time_retired = "+38.426"
sql_create_context
CREATE TABLE table_61555 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much money does the player with a score of 76-70-65-68=279 have?
SELECT "Money ( $ )" FROM table_61555 WHERE "Score" = '76-70-65-68=279'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, ...
SELECT Users.DisplayName AS "user_name", 'http://stackoverflow.com/users/' + CAST(answer.OwnerUserId AS TEXT(10)) AS "permalink", Users.Reputation, SUM(COALESCE(question.ViewCount, 0)) AS reached, COUNT(DISTINCT answer.Id) AS "total_answers", COUNT(DISTINCT question.Id) AS "accepted_answers" FROM Posts AS answer LEFT O...
sede
CREATE TABLE table_2562572_44 ( largest_ethnic_group__2002_ VARCHAR, cyrillic_name_other_names VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the largest ethnic group in in the settlement with the cyrillic name ?
SELECT largest_ethnic_group__2002_ FROM table_2562572_44 WHERE cyrillic_name_other_names = "Банатски Карловац"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.icd9_code = "4523"
mimicsql_data
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 400 AND 400 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = cou...
advising
CREATE TABLE table_27813 ( "Position" real, "Sail number" text, "Yacht" text, "State/country" text, "Yacht type" text, "LOA (Metres)" text, "Skipper" text, "Elapsed time d:hh:mm:ss" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ...
SELECT "Sail number" FROM table_27813 WHERE "Elapsed time d:hh:mm:ss" = '2:22:30:42'
wikisql
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, J...
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND person_info_hz_info.KH = hz_info.KH AND pers...
css
CREATE TABLE table_29803 ( "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_29803 WHERE "Title" = 'The One with All the Resolutions'
wikisql
CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge...
SELECT Last_year, COUNT(Last_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" GROUP BY Last_year
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.insurance = "Self Pay"
mimicsql_data
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY School_ID DESC
nvbench
CREATE TABLE table_65906 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country does Bo Bae Song play for?
SELECT "Country" FROM table_65906 WHERE "Player" = 'bo bae song'
wikisql
CREATE TABLE table_name_21 ( money___ INTEGER, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the most money ($) when the score is 71-74-69-72=286?
SELECT MAX(money___) AS $__ FROM table_name_21 WHERE score = 71 - 74 - 69 - 72 = 286
sql_create_context
CREATE TABLE table_name_99 ( record VARCHAR, method VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Record, when Method is KO, and when Opponent is Rich Guerin?
SELECT record FROM table_name_99 WHERE method = "ko" AND opponent = "rich guerin"
sql_create_context
CREATE TABLE table_name_54 ( artist VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Artist has a Week of Top 12?
SELECT artist FROM table_name_54 WHERE week = "top 12"
sql_create_context
CREATE TABLE table_name_56 ( time_retired VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the time/retired for driver richard attwood?
SELECT time_retired FROM table_name_56 WHERE driver = "richard attwood"
sql_create_context
CREATE TABLE salary ( year number, team_id text, league_id text, player_id text, salary number ) CREATE TABLE player_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first text ) CREATE TABLE player_awa...
SELECT player_id FROM salary WHERE year >= 2010 ORDER BY salary DESC LIMIT 1
thehistoryofbaseball
CREATE TABLE Research_Staff ( staff_details VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the research staff details, and order in ascending order.
SELECT staff_details FROM Research_Staff ORDER BY staff_details
sql_create_context
CREATE TABLE table_62242 ( "Date" text, "Opponents" text, "H / A" text, "Result F \u2013 A" text, "Attendance" real, "League position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the game against manchester city when they had a ...
SELECT "Date" FROM table_62242 WHERE "H / A" = 'a' AND "League position" = '2nd' AND "Opponents" = 'manchester city'
wikisql
CREATE TABLE table_33545 ( "Place" real, "Rider" text, "Country" text, "Machine" text, "Speed" text, "Time" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which rider had a points score equal to 10?
SELECT "Rider" FROM table_33545 WHERE "Points" = '10'
wikisql
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( ...
SELECT County_name, COUNT(County_name) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY County_name ORDER BY County_name
nvbench
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) 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, additio...
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '08:45' AND course.course_id = course_offering.course_id AND course.department = 'CAAS' AND course.number = 512 AND semester.semester = 'WN' AND ...
advising
CREATE TABLE table_203_102 ( id number, "event" text, "performance" text, "athlete" text, "nation" text, "place" text, "date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who set consecutive world records in the 100m ?
SELECT "athlete" FROM table_203_102 WHERE "event" = '100 m'
squall
CREATE TABLE table_name_14 ( grid INTEGER, rider VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Grid has a Rider of loic napoleone?
SELECT AVG(grid) FROM table_name_14 WHERE rider = "loic napoleone"
sql_create_context
CREATE TABLE table_name_91 ( date VARCHAR, result VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date of the game with a Loss and Record of 7-9?
SELECT date FROM table_name_91 WHERE result = "loss" AND record = "7-9"
sql_create_context
CREATE TABLE table_73248 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Regular Season Winner" FROM table_73248 WHERE "Conference" = 'Ivy League'
wikisql
CREATE TABLE table_name_77 ( result VARCHAR, first_elected VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for incumbent Joseph McKenna who was first elected in 1884?
SELECT result FROM table_name_77 WHERE first_elected = "1884" AND incumbent = "joseph mckenna"
sql_create_context
CREATE TABLE table_63025 ( "Year" real, "Place" text, "Gold" text, "Silver" text, "Bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the Gold Medal in Moscow after the year 1982?
SELECT "Gold" FROM table_63025 WHERE "Year" > '1982' AND "Place" = 'moscow'
wikisql
CREATE TABLE table_name_86 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent on November 26, 1989?
SELECT opponent FROM table_name_86 WHERE date = "november 26, 1989"
sql_create_context
CREATE TABLE table_48998 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the lowest points when name is ehc m nchen ii and position is less than 7?
SELECT MIN("Points") FROM table_48998 WHERE "Name" = 'ehc münchen ii' AND "Position" < '7'
wikisql
CREATE TABLE table_17158 ( "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. -- During which years did number 13 play for the Roc...
SELECT "Years for Rockets" FROM table_17158 WHERE "No.(s)" = '13'
wikisql
CREATE TABLE table_51871 ( "Planet" text, "Planet Type" text, "Semimajor Axis ( AU )" real, "Orbital Period" text, "Radial velocity (m/s)" real, "Detectable by:" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What planet orbits in 3.23 days?
SELECT "Planet" FROM table_51871 WHERE "Orbital Period" = '3.23 days'
wikisql
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city v...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND diagnoses.short_title = "Acute respiratry failure"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'alt (sgpt)' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '015-21757' AND NOT pa...
eicu
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 procedures.icd9_code = "3806"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'non-invas...
eicu
CREATE TABLE table_18693 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what district was the incumbent Cordell hull?
SELECT "District" FROM table_18693 WHERE "Incumbent" = 'Cordell Hull'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id numb...
WITH TOPUSERS(Id, PostCount) AS (SELECT u.Id, COUNT(*) FROM Users AS u INNER JOIN Posts AS p ON u.Id = p.OwnerUserId INNER JOIN Posts AS q ON p.ParentId = q.Id INNER JOIN PostTags AS pt ON q.Id = pt.PostId WHERE u.Reputation > 1000 AND u.Location LIKE '%India' AND p.PostTypeId = 2 AND pt.TagId = 1386 GROUP BY u.Id) SEL...
sede
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartments ...
SELECT apt_number, room_count FROM Apartments ORDER BY room_count DESC
nvbench
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
SELECT u.DisplayName COLLATE SQL_Latin1_General_CP1_CI_AS AS "user_link", COUNT(*) AS "times_name_used" FROM Users AS u GROUP BY u.DisplayName COLLATE SQL_Latin1_General_CP1_CI_AS ORDER BY COUNT(*) DESC LIMIT 10
sede
CREATE TABLE device ( device_id number, device text, carrier text, package_version text, applications text, software_platform text ) CREATE TABLE stock ( shop_id number, device_id number, quantity number ) CREATE TABLE shop ( shop_id number, shop_name text, location tex...
SELECT T2.shop_name FROM stock AS T1 JOIN shop AS T2 ON T1.shop_id = T2.shop_id GROUP BY T1.shop_id ORDER BY SUM(T1.quantity) DESC LIMIT 1
spider
CREATE TABLE table_name_32 ( driver VARCHAR, team VARCHAR, chassis VARCHAR, engine VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the driver with a rotax max engine, in the rotax heavy class, with arrow as chass...
SELECT driver FROM table_name_32 WHERE engine = "rotax max" AND class = "rotax heavy" AND chassis = "arrow" AND team = "twr raceline seating"
sql_create_context
CREATE TABLE table_1320857_1 ( fa_brill VARCHAR, wh_archer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the fa.brill when w.h. archer is known as r. newman?
SELECT fa_brill FROM table_1320857_1 WHERE wh_archer = "R. Newman"
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 d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'spon ab w compl nec-unsp' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'spon ab w compl nec-unsp'
mimic_iii
CREATE TABLE movie ( movie_id number, title text, year number, director text, budget_million number, gross_worldwide number ) CREATE TABLE culture_company ( company_name text, type text, incorporated_in text, group_equity_shareholding number, book_club_id text, movie_id ...
SELECT T1.title, T3.book_title FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id JOIN book_club AS T3 ON T3.book_club_id = T2.book_club_id WHERE T2.incorporated_in = 'China'
spider
CREATE TABLE table_5518 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest attendance at the game with a record of 50-36?
SELECT MIN("Attendance") FROM table_5518 WHERE "Record" = '50-36'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-7984')) AND lab.labname = 'glucose' AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_...
eicu
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND procedures.short_title = "Packed cell transfusion"
mimicsql_data
CREATE TABLE table_3819 ( "No. in series" text, "No. in season" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT COUNT("No. in series") FROM table_3819 WHERE "U.S. viewers (millions)" = '5.2'
wikisql
CREATE TABLE table_11676 ( "Peak" text, "Height (m)" real, "Prom. (m)" real, "Class" text, "Parent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the prom with Hewitt class and a Height (m) of 715?
SELECT "Prom. (m)" FROM table_11676 WHERE "Class" = 'hewitt' AND "Height (m)" = '715'
wikisql
CREATE TABLE table_71893 ( "Episode" text, "First aired" text, "Entrepreneur(s)" text, "Company or product name" text, "Money requested (\u00a3)" text, "Investing Dragon(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Company or ...
SELECT "Company or product name" FROM table_71893 WHERE "Money requested (\u00a3)" = '75,000' AND "Entrepreneur(s)" = 'geoff and colette bell'
wikisql
CREATE TABLE table_40206 ( "Nat." text, "Name" text, "Since" real, "App(L/C/E)" text, "Goals(L/C/E)" text, "Ends" real, "Transfer fee" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Since, when Notes is T...
SELECT MIN("Since") FROM table_40206 WHERE "Notes" = 'to anagennisi karditsa' AND "App(L/C/E)" = '0 (0/0/0)'
wikisql
CREATE TABLE table_name_98 ( top_10 INTEGER, wins VARCHAR, top_25 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Top 10 performances that have more than 2 wins and is higher than number 16 in the Top 25?
SELECT SUM(top_10) FROM table_name_98 WHERE wins > 2 AND top_25 < 16
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE compartment_class ( compartment varchar, ...
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, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND fare_basis.class_type = 'FIRST' AND fare.fare_...
atis
CREATE TABLE table_27060 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 'the kissing game' is...
SELECT "Directed by" FROM table_27060 WHERE "Title" = 'The Kissing Game'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDat...
SELECT COUNT(RejectionDate) AS Rejected, COUNT(ApprovalDate) AS Approved FROM SuggestedEdits WHERE Comment LIKE '%@%.com' AND CreationDate > CURRENT_TIMESTAMP() - 90
sede
CREATE TABLE customers ( customer_id number, customer_details text ) CREATE TABLE settlements ( settlement_id number, claim_id number, date_claim_made time, date_claim_settled time, amount_claimed number, amount_settled number, customer_policy_id number ) CREATE TABLE claims ( ...
SELECT policy_type_code FROM customer_policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_19 ( overall INTEGER, pick__number VARCHAR, position VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest overall of the wide receiver player from a round higher than 5 and a pick lower than 7?
SELECT MIN(overall) FROM table_name_19 WHERE position = "wide receiver" AND round < 5 AND pick__number > 7
sql_create_context
CREATE TABLE table_32928 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During what week was the match on November 10, 1963?
SELECT AVG("Week") FROM table_32928 WHERE "Date" = 'november 10, 1963'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.short_title = "Unilat rad neck dissect"
mimicsql_data
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, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road
nvbench
CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_cit...
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_40 ( game_site VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the game site for october 4, 1992
SELECT game_site FROM table_name_40 WHERE date = "october 4, 1992"
sql_create_context
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 hz_info ( KH text, KLX number...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE table_name_96 ( country VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what country is Aberdeen?
SELECT country FROM table_name_96 WHERE location = "aberdeen"
sql_create_context
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 diagnosis ( diagn...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-1459')) AND medication.routeadmin = 'intraven' AND DATETIME(med...
eicu
CREATE TABLE table_53040 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance when the Arden Street Ov...
SELECT "Crowd" FROM table_53040 WHERE "Venue" = 'arden street oval'
wikisql
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) ...
SELECT pPos, MIN(T2.HS) FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID GROUP BY pPos ORDER BY MIN(T2.HS) DESC
nvbench
CREATE TABLE table_255188_1 ( founded INTEGER, institution VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was Piedmont College founded?
SELECT MAX(founded) FROM table_255188_1 WHERE institution = "Piedmont College"
sql_create_context
CREATE TABLE table_203_61 ( 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. -- which nation won more gold medals than south africa ?
SELECT "nation" FROM table_203_61 WHERE "gold" > (SELECT "gold" FROM table_203_61 WHERE "nation" = 'south africa')
squall
CREATE TABLE CHARACTERISTICS ( characteristic_name VARCHAR, characteristic_id VARCHAR ) CREATE TABLE products ( product_id VARCHAR, product_name VARCHAR ) CREATE TABLE product_characteristics ( product_id VARCHAR, characteristic_id VARCHAR ) -- Using valid SQLite, answer the following questi...
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 WHERE t1.product_name = "sesame"
sql_create_context
CREATE TABLE table_name_68 ( high_rebounds VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high rebounds on January 24?
SELECT high_rebounds FROM table_name_68 WHERE date = "january 24"
sql_create_context
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, ...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co...
advising
CREATE TABLE table_13505192_3 ( series_number INTEGER, episode_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What number episode in the series is the episode 'things that fly'?
SELECT MAX(series_number) FROM table_13505192_3 WHERE episode_title = "Things That Fly"
sql_create_context
CREATE TABLE table_204_667 ( id number, "year" number, "film title" text, "genre" text, "cast" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- besides kshana kshana , which other film is a suspense thriller ?
SELECT "film title" FROM table_204_667 WHERE "film title" <> 'kshana kshana' AND "genre" = 'suspense thriller'
squall
CREATE TABLE table_13651 ( "Round" real, "Dates" text, "Rally Name" text, "Rally HQ" text, "Support Category" text, "Surface" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which dates have a Rally HQ of kingscliff?
SELECT "Dates" FROM table_13651 WHERE "Rally HQ" = 'kingscliff'
wikisql
CREATE TABLE table_76850 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Club" FROM table_76850 WHERE "Points" = '22'
wikisql
CREATE TABLE table_58482 ( "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 average laps for Grid 9?
SELECT AVG("Laps") FROM table_58482 WHERE "Grid" = '9'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
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 NOT vitalperiodic.sao2 IS NULL AN...
eicu
CREATE TABLE table_23429 ( "Colt model no." text, "Military designation" text, "Barrel Length" text, "Barrel" text, "Handguard type" text, "Buttstock type" text, "Pistol grip type" text, "Lower receiver type" text, "Upper receiver type" text, "Rear sight type" text, "Front si...
SELECT COUNT("Case deflector?") FROM table_23429 WHERE "Colt model no." = '646'
wikisql
CREATE TABLE table_65413 ( "Region" text, "Date" text, "Format" text, "Label" text, "Edition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Hollywood Records release a digital download?
SELECT "Date" FROM table_65413 WHERE "Label" = 'hollywood records' AND "Format" = 'digital download'
wikisql
CREATE TABLE table_name_98 ( fourth_district VARCHAR, first_district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the Fourth District with a First District of beverly bodem?
SELECT fourth_district FROM table_name_98 WHERE first_district = "beverly bodem"
sql_create_context
CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, de...
SELECT COUNT(DISTINCT eid) FROM certificate
spider
CREATE TABLE table_21824695_8 ( match_played VARCHAR, highest VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many match played have the highest as 32250?
SELECT match_played FROM table_21824695_8 WHERE highest = 32250
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid 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 = 29309)) AND STRFTIME('%y-%m-%d', outputeve...
mimic_iii
CREATE TABLE table_203_741 ( id number, "season" text, "competition" text, "round" text, "opponent" text, "home" text, "away" text, "aggregate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which years did they have at least 1 home win ...
SELECT DISTINCT "season" FROM table_203_741 WHERE "home" > "home"
squall
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ulcer esophagus w bleed') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year')...
mimic_iii
CREATE TABLE table_75664 ( "Wrestler" text, "Reign" text, "Days held" text, "Location" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of event had the wrestler with a reign of 2 and held the title for 35 days?
SELECT "Event" FROM table_75664 WHERE "Reign" = '2' AND "Days held" = '35'
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 zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers...
css
CREATE TABLE table_35076 ( "Player" text, "Played" real, "Sets Won" real, "Sets Lost" real, "Legs Won" real, "Legs Lost" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" real ) -- Using valid SQLite, answer the following questions for the ...
SELECT MAX("100+") FROM table_35076 WHERE "Sets Won" < '1' AND "Legs Won" > '2'
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "9110" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_name_26 ( pick INTEGER, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average pick in 1983?
SELECT AVG(pick) FROM table_name_26 WHERE year = 1983
sql_create_context
CREATE TABLE table_34092 ( "Version" text, "Length" text, "Album" text, "Remixed by" text, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who remixed the version with a length of 3:58?
SELECT "Remixed by" FROM table_34092 WHERE "Length" = '3:58'
wikisql
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY MIN(Weight) DESC
nvbench