instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_24018112_1 ( brand_name VARCHAR, model__list_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What brand is model I7-8xx?
SELECT brand_name FROM table_24018112_1 WHERE model__list_ = "i7-8xx"
sql_create_context
CREATE TABLE zyb ( CLINIC_ID 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, INSU_TYPE text, IN...
SELECT qtb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '7883638' GROUP BY qtb.MED_ORG_DEPT_CD UNION SELECT gyb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_...
css
CREATE TABLE table_22841 ( "Rank" real, "Race Number" real, "Name" text, "NOC" text, "- 250m" text, "- 500m" text, "- 750m" text, "- 1,000m" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the -250m is 18.852, what is the
SELECT "- 750m" FROM table_22841 WHERE "- 250m" = '18.852'
wikisql
CREATE TABLE table_name_90 ( games INTEGER, season VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum number of games when the season is more recent than 2001 and the average is less than 10,838?
SELECT MAX(games) FROM table_name_90 WHERE season > 2001 AND average < 10 OFFSET 838
sql_create_context
CREATE TABLE table_30033 ( "Series #" real, "Season #" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the series number fo...
SELECT "Series #" FROM table_30033 WHERE "Season #" = '10'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 4)
mimic_iii
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varc...
SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME
nvbench
CREATE TABLE table_name_30 ( voltage_range VARCHAR, fsb_speed VARCHAR, clock_speed VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Voltage Range which has a FSB Speed of 400 mhz, and a Clock Speed of 1 ghz?
SELECT voltage_range FROM table_name_30 WHERE fsb_speed = "400 mhz" AND clock_speed = "1 ghz"
sql_create_context
CREATE TABLE table_78771 ( "Year" real, "Competition" text, "Awards" text, "Category" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the year that had Anugerah Bintang Popular Berita Harian 23 as competition?
SELECT COUNT("Year") FROM table_78771 WHERE "Competition" = 'anugerah bintang popular berita harian 23'
wikisql
CREATE TABLE table_name_11 ( result VARCHAR, score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Score of 0 0, and a Date of 02-jan-64 had what result?
SELECT result FROM table_name_11 WHERE score = "0–0" AND date = "02-jan-64"
sql_create_context
CREATE TABLE table_name_61 ( music VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which music has the notes of AKA Africa Uncensored?
SELECT music FROM table_name_61 WHERE notes = "aka africa uncensored"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE"
mimicsql_data
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, ...
SELECT v.PostId AS "post_link" FROM Votes AS v INNER JOIN (SELECT Id, Reputation FROM Users) AS u ON u.Id = v.UserId GROUP BY v.PostId HAVING SUM(CASE WHEN u.Reputation < 200 THEN 1 ELSE 0 END) > 0 AND SUM(CASE WHEN u.Reputation >= 200 THEN 1 ELSE 0 END) = 0
sede
CREATE TABLE table_16405 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pick number of regina?
SELECT "Pick #" FROM table_16405 WHERE "College" = 'Regina'
wikisql
CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREATE TABLE game ( ...
SELECT Season, COUNT(Season) FROM game GROUP BY Season
nvbench
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.age < "44" AND procedures.icd9_code = "93"
mimicsql_data
CREATE TABLE table_52755 ( "Title" text, "Author(s)" text, "Recorded" text, "Location(s)" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the song that runs for 2:22?
SELECT "Author(s)" FROM table_52755 WHERE "Time" = '2:22'
wikisql
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 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 = 1372)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe...
mimic_iii
CREATE TABLE table_5601 ( "Season" text, "Regionalliga S\u00fcd" text, "Regionalliga West/S\u00fcdwest" text, "Regionalliga Nord" text, "Regionalliga Nord-Ost" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Regionalliga West/Sudwest had a Regi...
SELECT "Regionalliga West/S\u00fcdwest" FROM table_5601 WHERE "Regionalliga Nord-Ost" = 'carl zeiss jena'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Other and unspecified coronary arteriography"
mimicsql_data
CREATE TABLE table_name_5 ( average INTEGER, yards VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of average values for 23 yards?
SELECT SUM(average) FROM table_name_5 WHERE yards = 23
sql_create_context
CREATE TABLE table_name_2 ( goals_for INTEGER, team VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Goals For, when Team is 'Cheadle Town', and when Drawn is greater than 7?
SELECT MAX(goals_for) FROM table_name_2 WHERE team = "cheadle town" AND drawn > 7
sql_create_context
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 ReviewTaskStates ( Id number, Name te...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%pakistan%' OR UPPER(Location) LIKE '%PAK' ORDER BY Reputation DESC LIMIT 500
sede
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_kc24.t_kc21_IN_DIAG_DIS_CD, t_kc24.t_kc21_IN_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_ID = '37329044' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6376.37)
css
CREATE TABLE table_22344463_2 ( position VARCHAR, height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the height is 181cm, what was the position?
SELECT position FROM table_22344463_2 WHERE height = "181cm"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Acute uri NOS" AND prescriptions.route = "PO"
mimicsql_data
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
sede
CREATE TABLE table_test_25 ( "id" int, "ejection_fraction_ef" int, "respiratory_tract_infection" bool, "left_ventricular_ejection_fraction_lvef" int, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "central_diabetes_insipidus" bool, "hyponatremia" bool, "hea...
SELECT * FROM table_test_25 WHERE creatinine_clearance_cl > 2
criteria2sql
CREATE TABLE table_60389 ( "Year" real, "Gold" text, "Silver" text, "Bronze" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the Notes against a Silver for Jenny Johansson earlier than 2006?
SELECT "Notes" FROM table_60389 WHERE "Year" < '2006' AND "Silver" = 'jenny johansson'
wikisql
CREATE TABLE table_61059 ( "Year" real, "Domestic" real, "International" real, "Total" real, "Change" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the international lower than 17,517 and domestic was less than 545?
SELECT AVG("Year") FROM table_61059 WHERE "International" < '17,517' AND "Domestic" < '545'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE (((CITY_1....
atis
CREATE TABLE table_name_51 ( name VARCHAR, red_list INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name with a red lest less than 7?
SELECT name FROM table_name_51 WHERE red_list < 7
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE area ( course_id int, ...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id...
advising
CREATE TABLE table_name_12 ( route VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which route has a Date of 2 july?
SELECT route FROM table_name_12 WHERE date = "2 july"
sql_create_context
CREATE TABLE table_203_207 ( id number, "site name" text, "reason for designation\nbiological interest" number, "reason for designation\ngeological interest" number, "area\nhectares" number, "area\nacres" number, "coordinates & grid ref" text, "year in which notified" number, "other ...
SELECT "site name" FROM table_203_207 WHERE "site name" IN ("carver's rocks", 'cawdor quarry') ORDER BY "area\nacres" DESC LIMIT 1
squall
CREATE TABLE table_name_63 ( label_s_ VARCHAR, year_of_release VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the label of the album titled and released in 1994?
SELECT label_s_ FROM table_name_63 WHERE year_of_release = 1994 AND title = "與你相逢"
sql_create_context
CREATE TABLE table_name_63 ( notes VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Notes of the Frequency with Format of talk radio?
SELECT notes FROM table_name_63 WHERE format = "talk radio"
sql_create_context
CREATE TABLE table_54778 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text, "Apparent magnitude" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest NGC n...
SELECT MAX("NGC number") FROM table_54778 WHERE "Declination ( J2000 )" = '°04′58″' AND "Apparent magnitude" > '7.3'
wikisql
CREATE TABLE table_79888 ( "Category" text, "Film" text, "Director(s)" text, "Country" text, "Nominating Festival" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What film did ian mackinnon direct that was in the short film 2007 prix uip category?
SELECT "Film" FROM table_79888 WHERE "Category" = 'short film 2007 prix uip' AND "Director(s)" = 'ian mackinnon'
wikisql
CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARC...
SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = "Fanny" ORDER BY COUNT(date_of_notes)
nvbench
CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARC...
SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code
nvbench
CREATE TABLE table_51461 ( "Episode" text, "Air Date" text, "Timeslot" text, "Households (Rating/Share)" text, "18-49 (Rating/Share)" text, "Viewers (m)" real, "Weekly Rank (#)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 18-49 r...
SELECT "18-49 (Rating/Share)" FROM table_51461 WHERE "Weekly Rank (#)" = '30'
wikisql
CREATE TABLE table_204_63 ( id number, "round" number, "circuit" text, "date" text, "pole position" text, "winning driver" text, "winning team" text, "trophy winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the only winning ...
SELECT "winning driver" FROM table_204_63 WHERE "winning team" = 'target racing' GROUP BY "winning driver" HAVING COUNT(*) = 1
squall
CREATE TABLE table_71943 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game that had a loss of Geisel (0-1)?
SELECT "Date" FROM table_71943 WHERE "Loss" = 'geisel (0-1)'
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 MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "ASIAN"
mimicsql_data
CREATE TABLE table_name_35 ( election VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 3rd Party in the Election of 1922?
SELECT 3 AS rd_party FROM table_name_35 WHERE election = "1922"
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.marital_status = "MARRIED" AND prescriptions.route = "PB"
mimicsql_data
CREATE TABLE table_63944 ( "Lane" real, "Name" text, "Nationality" text, "Reaction" real, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many lanes does Australia have with a reaction smaller than 0.138?
SELECT COUNT("Lane") FROM table_63944 WHERE "Nationality" = 'australia' AND "Reaction" < '0.138'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dod_year < "2133.0"
mimicsql_data
CREATE TABLE table_76699 ( "Club" text, "City" text, "Sport" text, "League" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which sport had the club of the Montgomery Biscuits?
SELECT "Sport" FROM table_76699 WHERE "Club" = 'montgomery biscuits'
wikisql
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 Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY COUNT(Headquarter)
nvbench
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 COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 28 AND STRFTIME('%y', transfers.intime) <= '2104')
mimic_iii
CREATE TABLE table_63032 ( "Rank" real, "Peak" text, "Country" text, "Island" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Col (m) has a Prominence (m) larger than 1,897...
SELECT COUNT("Col (m)") FROM table_63032 WHERE "Prominence (m)" > '1,897' AND "Rank" < '6'
wikisql
CREATE TABLE table_204_722 ( id number, "season" text, "series" text, "team" text, "races" number, "wins" number, "poles" number, "f/lap" number, "podiums" number, "points" number, "position" text ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT "team" FROM table_204_722 WHERE "position" = 1 AND "season" < (SELECT "season" FROM table_204_722 WHERE "team" = 'mrf challenge')
squall
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) -- Using valid SQLite, answer the following questions fo...
SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY AVG(Tonnage) DESC
nvbench
CREATE TABLE volume ( Artist_ID VARCHAR, Weeks_on_Top INTEGER ) CREATE TABLE artist ( Famous_Title VARCHAR, Artist_ID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the famous title of the artists associated with volumes with more than 2 we...
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2
sql_create_context
CREATE TABLE table_28037619_2 ( title VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the episode written by David Matthews?
SELECT title FROM table_28037619_2 WHERE written_by = "David Matthews"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '苗秀曼' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 7265.59)
css
CREATE TABLE table_name_29 ( actor_required VARCHAR, actor_in_original_production VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the required actor when Robert Austin was the actor in the original production?
SELECT actor_required FROM table_name_29 WHERE actor_in_original_production = "robert austin"
sql_create_context
CREATE TABLE table_name_22 ( visiting_team VARCHAR, stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team visited the Cleveland Browns Stadium?
SELECT visiting_team FROM table_name_22 WHERE stadium = "cleveland browns stadium"
sql_create_context
CREATE TABLE table_204_697 ( id number, "song" text, "artist(s)" text, "concert" number, "film" number, "1978 album" number, "2002 album" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the first artist on the chart ?
SELECT "artist(s)" FROM table_204_697 WHERE id = 1
squall
CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text ) CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE student ...
SELECT emp_jobcode, COUNT(*) FROM employee GROUP BY emp_jobcode ORDER BY COUNT(*) DESC LIMIT 1
spider
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.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21_t_kc22.MED_CLINIC_ID = '78928227883' INTERSECT SELECT t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON ...
css
CREATE TABLE table_26103 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record when the opposing team was ...
SELECT "Record" FROM table_26103 WHERE "Opponent" = 'Pittsburgh Penguins'
wikisql
CREATE TABLE order_items ( order_id number, product_id number, order_quantity text ) CREATE TABLE customers ( customer_id number, payment_method text, customer_name text, date_became_customer time, other_customer_details text ) CREATE TABLE products ( product_id number, product...
SELECT country FROM addresses GROUP BY country HAVING COUNT(address_id) > 4
spider
CREATE TABLE table_12872 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- From which party is the incumbent who was first elected to office in 1990?
SELECT "Party" FROM table_12872 WHERE "First elected" = '1990'
wikisql
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2111.0" AND diagnoses.icd9_code = "E9503"
mimicsql_data
CREATE TABLE table_15154 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent has a record of 78-60?
SELECT "Opponent" FROM table_15154 WHERE "Record" = '78-60'
wikisql
CREATE TABLE table_204_951 ( id number, "candidate" text, "votes" number, "percentage" text, "counties" number, "delegates" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many candidates received over 10 % of the vote ?
SELECT COUNT("candidate") FROM table_204_951 WHERE "percentage" > 10
squall
CREATE TABLE checking ( balance VARCHAR, custid VARCHAR ) CREATE TABLE accounts ( custid VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the checking balance of the account whose owner s name contains the substring ee ?
SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%'
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, ...
SELECT AVG(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195316') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y', patient.unitadmittime) >= '2105' GROUP BY STRFTIME('%y-%m', patient.unitad...
eicu
CREATE TABLE table_47755 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent of the match played on a Clay Surface with a Score of 6 0, 6 2?
SELECT "Opponent in the final" FROM table_47755 WHERE "Surface" = 'clay' AND "Score" = '6–0, 6–2'
wikisql
CREATE TABLE table_name_39 ( money_requested__£_ VARCHAR, company_or_product_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much money did the company Neurotica request?
SELECT money_requested__£_ FROM table_name_39 WHERE company_or_product_name = "neurotica"
sql_create_context
CREATE TABLE table_name_83 ( surface VARCHAR, opponent_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the surface type at Takao Suzuki?
SELECT surface FROM table_name_83 WHERE opponent_in_the_final = "takao suzuki"
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.ethnicity = "BLACK/HAITIAN"
mimicsql_data
CREATE TABLE table_69432 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many were in attendance on October 27, 1963?
SELECT MAX("Attendance") FROM table_69432 WHERE "Date" = 'october 27, 1963'
wikisql
CREATE TABLE table_77596 ( "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 is the date of the game when attendance is more than 20,682?
SELECT "Date" FROM table_77596 WHERE "Attendance" > '20,682'
wikisql
CREATE TABLE table_name_3 ( week INTEGER, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What week had attendance of 64,146?
SELECT MIN(week) FROM table_name_3 WHERE attendance = 64 OFFSET 146
sql_create_context
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 T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T2.Revenue DESC
nvbench
CREATE TABLE table_47697 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Gold has a Bronze of 1, and a Total smaller than 3?
SELECT AVG("Gold") FROM table_47697 WHERE "Bronze" = '1' AND "Total" < '3'
wikisql
CREATE TABLE table_47568 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent has w 17-0 as the result?
SELECT "Opponent" FROM table_47568 WHERE "Result" = 'w 17-0'
wikisql
CREATE TABLE table_76392 ( "Year" text, "Result" text, "Matches" text, "Wins" text, "Draws" text, "Losses" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the matches where the teams finished in the first group stage, in 1998?
SELECT "Matches" FROM table_76392 WHERE "Result" = 'first group stage' AND "Year" = '1998'
wikisql
CREATE TABLE table_name_43 ( rank VARCHAR, nationality VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank did Poland receive with a time of 1:50.12?
SELECT rank FROM table_name_43 WHERE nationality = "poland" AND time = "1:50.12"
sql_create_context
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.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3491233' GROUP BY gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3491233' GROUP BY fgwyjzb.IN_DIAG_DIS_CD
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 1108 AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-5 year')
eicu
CREATE TABLE table_name_21 ( winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 1st prize ($) has a Winner of scott simpson (7)?
SELECT SUM(1 AS st_prize___) AS $__ FROM table_name_21 WHERE winner = "scott simpson (7)"
sql_create_context
CREATE TABLE table_53741 ( "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 date of the game where North Melbou...
SELECT "Date" FROM table_53741 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE table_name_91 ( celebrity VARCHAR, finished VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the celebrity who finished in 7th place?
SELECT celebrity FROM table_name_91 WHERE finished = "7th"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ONDA4I"
mimicsql_data
CREATE TABLE table_43838 ( "Series" text, "Title" text, "Broadcasts (TV) 1" real, "Episodes (TV+extra) 2" text, "Directors" text, "Aired in Japan 3" text, "US Release Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Br...
SELECT SUM("Broadcasts (TV) 1") FROM table_43838 WHERE "Series" = '3 4' AND "US Release Date" = '27 december 2006'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, ...
SELECT * FROM Posts WHERE PostTypeId = 1 AND CreationDate >= '01/01/2018' AND (Tags LIKE '%mobile%' OR Tags LIKE '%xamarin%') AND Body LIKE '%Windows%Phone%'
sede
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.gender = "F" AND demographic.ethnicity = "HISPANIC OR LATINO"
mimicsql_data
CREATE TABLE table_25200461_9 ( d_r_spread VARCHAR, no_party_preference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the d-r spread if the no party preference is 31.8%?
SELECT d_r_spread FROM table_25200461_9 WHERE no_party_preference = "31.8%"
sql_create_context
CREATE TABLE table_10719 ( "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 did Footscray score at the home game?
SELECT "Home team score" FROM table_10719 WHERE "Home team" = 'footscray'
wikisql
CREATE TABLE city ( city_id number, official_name text, status text, area_km_2 number, population number, census_ranking text ) CREATE TABLE farm ( farm_id number, year number, total_horses number, working_horses number, total_cattle number, oxen number, bulls number...
SELECT COUNT(*) FROM farm
spider
CREATE TABLE table_name_18 ( order VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What order has the title Deacon of SS. Cosma E Damiano?
SELECT order FROM table_name_18 WHERE title = "deacon of ss. cosma e damiano"
sql_create_context
CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ) CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ) CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ...
SELECT Name, COUNT(Name) FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Negative = T3.People_ID GROUP BY Name
nvbench
CREATE TABLE table_31413 ( "Rank" real, "Country/Territory" text, "Miss Earth" text, "Miss Air" real, "Miss Water" real, "Miss Fire" real, "Semifinalists" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least amo...
SELECT MIN("Miss Air") FROM table_31413
wikisql
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 microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND microlab.culturesite = 'other' AND DATETIME(micro...
eicu
CREATE TABLE table_name_4 ( internet_explorer VARCHAR, opera VARCHAR, period VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What internet explorer has 1.67% as the opera, with 2012 q1 as the period?
SELECT internet_explorer FROM table_name_4 WHERE opera = "1.67%" AND period = "2012 q1"
sql_create_context