instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY Team_ID
nvbench
CREATE TABLE table_34578 ( "Draw" real, "Artist" text, "Song" text, "Points" real, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the song for points less than 16 and draw less than 3
SELECT "Song" FROM table_34578 WHERE "Points" < '16' AND "Draw" < '3'
wikisql
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT AVG(age), MIN(age) FROM captain GROUP BY Class
nvbench
CREATE TABLE table_65908 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many teams won more than 2 silver medals and fewer than 2 Bronze medals?
SELECT COUNT("Rank") FROM table_65908 WHERE "Silver" > '2' AND "Bronze" < '2'
wikisql
CREATE TABLE table_35184 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- March of 29 involves what highest scoring game?
SELECT MAX("Game") FROM table_35184 WHERE "March" = '29'
wikisql
CREATE TABLE table_name_77 ( points INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Points have an Opponent of @ calgary flames?
SELECT SUM(points) FROM table_name_77 WHERE opponent = "@ calgary flames"
sql_create_context
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_name_8 ( losses INTEGER, club VARCHAR, draws VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the losses of Warrnambool with a draw less than 19?
SELECT AVG(losses) FROM table_name_8 WHERE club = "warrnambool" AND draws < 19
sql_create_context
CREATE TABLE qtb ( 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_NM, 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 = '9886124' GROUP BY qtb.MED_ORG_DEPT_NM UNION SELECT gyb.MED_ORG_DEPT_NM, 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_50289 ( "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 HAS A SCORE OF 68-70=138?
SELECT "Country" FROM table_50289 WHERE "Score" = '68-70=138'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text te...
SELECT Id AS "user_link" FROM Users WHERE Reputation = '##Reputation:int##'
sede
CREATE TABLE table_name_61 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the result for 2008-12-23
SELECT result FROM table_name_61 WHERE date = "2008-12-23"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Bod...
SELECT AVG(CAST(Score AS FLOAT)) AS AverageAnswerScore FROM Posts WHERE PostTypeId = 1
sede
CREATE TABLE table_40170 ( "Name" text, "League" text, "FA Cup" text, "League Cup" text, "Football League Trophy" text, "Watney Cup" text, "Welsh Cup" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Total, when FA Cu...
SELECT "Total" FROM table_40170 WHERE "FA Cup" = '1 0 (3)'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2043" AND prescriptions.drug = "Multivitamins"
mimicsql_data
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text,...
SELECT DATEADD(mm, (YEAR(Votes.CreationDate) - 1900) * 12 + MONTH(Votes.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Upvotes FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Votes ON Votes.PostId = PostTags.PostId WHERE Tags.TagName IN ('excel') GROUP BY YEAR(Votes.CreationDate), MONTH(Vo...
sede
CREATE TABLE table_54873 ( "Party" text, "Results 2004" text, "Ifop 11/12/08" text, "Ifop 1/9/09" text, "Ipsos 3/14/09" text, "CSA 4/16/09" text, "OpinionWay 4/17/09" text, "Ifop 4/24/09" text, "Ipsos 5/2/09" text, "Ifop 5/11/09" text, "OpinionWay 5/11/09" text ) -- Using v...
SELECT "Ipsos 3/14/09" FROM table_54873 WHERE "Ifop 11/12/08" = '7%' AND "OpinionWay 4/17/09" = '5%'
wikisql
CREATE TABLE table_name_24 ( total_pts VARCHAR, total_pld INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of points for a total pld less than 38?
SELECT COUNT(total_pts) FROM table_name_24 WHERE total_pld < 38
sql_create_context
CREATE TABLE table_203_418 ( id number, "#" number, "player" text, "position" text, "height" number, "current club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how much taller is thomas pearson than garreth lodge ?
SELECT (SELECT "height" FROM table_203_418 WHERE "player" = 'thomas pearson') - (SELECT "height" FROM table_203_418 WHERE "player" = 'garreth lodge')
squall
CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(10), customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) ) CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_s...
SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Ventricular fibrillation" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_204_568 ( id number, "pennant" text, "name" text, "hull builder" text, "ordered" text, "laid down" text, "launched" text, "accepted into service" text, "commissioned" text, "est. building cost" text, "fate" text ) -- Using valid SQLite, answer the followi...
SELECT "pennant" FROM table_204_568 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_ca...
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE table_name_61 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On which date was the venue at Windy Hill?
SELECT date FROM table_name_61 WHERE venue = "windy hill"
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 demographic ...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.age >= "85"
mimicsql_data
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATET...
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" GROUP BY date_of_completion ORDER BY COUNT(date_of_completion)
nvbench
CREATE TABLE table_71125 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Tyres" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years were g Tyres and Minardi m187 used?
SELECT AVG("Year") FROM table_71125 WHERE "Tyres" = 'g' AND "Chassis" = 'minardi m187'
wikisql
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.short_title = "Lumbago"
mimicsql_data
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '9683754' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-18' AND '2005-04-20'
css
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2165.0" AND procedures.short_title = "Heart countershock NEC"
mimicsql_data
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "30" AND lab.label = "Albumin, Body Fluid"
mimicsql_data
CREATE TABLE table_22597626_1 ( year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was John McEnroe's minimum year?
SELECT MIN(year) FROM table_22597626_1
sql_create_context
CREATE TABLE table_12015 ( "Rider" text, "Horse" text, "Faults" text, "Round 1 + 2A Points" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the round 1 +2A points for horse of poncorde
SELECT "Round 1 + 2A Points" FROM table_12015 WHERE "Horse" = 'poncorde'
wikisql
CREATE TABLE table_29583441_1 ( production_code INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest numbered production code listed?
SELECT MIN(production_code) FROM table_29583441_1
sql_create_context
CREATE TABLE table_25789 ( "City / Municipality" text, "No. of Barangays" real, "Area (km\u00b2)" text, "Population (2010 Census)" real, "Pop. density (per km\u00b2)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the city/munici...
SELECT "City / Municipality" FROM table_25789 WHERE "Pop. density (per km\u00b2)" = '1,388.88'
wikisql
CREATE TABLE Events ( Event_ID INTEGER, Address_ID INTEGER, Channel_ID INTEGER, Event_Type_Code CHAR(15), Finance_ID INTEGER, Location_ID INTEGER ) CREATE TABLE Locations ( Location_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Products ( Product_ID INTEGER, Product_Typ...
SELECT Product_Name, COUNT(Product_Name) FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events) GROUP BY Product_Name
nvbench
CREATE TABLE table_26284 ( "Episode" text, "Director" text, "Writer" text, "Original air date" text, "Ratings (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the writer when the ratings was 2.61 million?
SELECT "Writer" FROM table_26284 WHERE "Ratings (millions)" = '2.61'
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 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.expire_flag = "1" AND diagnoses.long_title = "Unspecified osteomyelitis, other specified sites"
mimicsql_data
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit 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.icd9_code = "2767" AND prescriptions.route = "PR"
mimicsql_data
CREATE TABLE table_name_25 ( home_team VARCHAR, ground VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team score of the Ghantoot Racing and Polo Club Ground?
SELECT home_team AS score FROM table_name_25 WHERE ground = "ghantoot racing and polo club"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id...
SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS m, TagName, COUNT(*) FROM PostTags AS pt JOIN Posts AS q ON q.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE TagName IN ('go', 'rust', 'flutter', 'dart') AND q.CreationDate < DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0) GROUP BY DATEADD(month, DA...
sede
CREATE TABLE table_28677723_11 ( tor_fløysvik VARCHAR, christer_tornell VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many for floysvik and christer tornell is 7?
SELECT COUNT(tor_fløysvik) FROM table_28677723_11 WHERE christer_tornell = 7
sql_create_context
CREATE TABLE table_31700 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the total number of attendance for result of l 18-6
SELECT COUNT("Attendance") FROM table_31700 WHERE "Result" = 'l 18-6'
wikisql
CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Employees ( Employee_ID INTEGER, ...
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations ORDER BY COUNT(Date_in_Locaton_To) DESC
nvbench
CREATE TABLE table_name_8 ( commissioned VARCHAR, laid_down VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the commissioned date with laid down of 17 dec 1951?
SELECT commissioned FROM table_name_8 WHERE laid_down = "17 dec 1951"
sql_create_context
CREATE TABLE table_30619 ( "No" real, "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the chassis for ludwig fischer
SELECT "Chassis" FROM table_30619 WHERE "Driver" = 'Ludwig Fischer'
wikisql
CREATE TABLE table_73701 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When alicia molik is the partner what is the outcome?
SELECT "Outcome" FROM table_73701 WHERE "Partner" = 'Alicia Molik'
wikisql
CREATE TABLE table_69278 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the name of the host team at Texas stadium?
SELECT "Host Team" FROM table_69278 WHERE "Stadium" = 'texas stadium'
wikisql
CREATE TABLE table_43842 ( "School" text, "Location" text, "Founded" real, "Affiliation" text, "Nickname" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the affiliation of the University of Maryland?
SELECT "Affiliation" FROM table_43842 WHERE "School" = 'university of maryland'
wikisql
CREATE TABLE table_name_89 ( venue VARCHAR, year VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Venue, when Year is after 2003, and when Tournament is 'Hypo-Meeting'?
SELECT venue FROM table_name_89 WHERE year > 2003 AND tournament = "hypo-meeting"
sql_create_context
CREATE TABLE table_25816476_2 ( team_swash VARCHAR, team_guest_captain VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the team swash when the team guest captain was gail porter?
SELECT team_swash FROM table_25816476_2 WHERE team_guest_captain = "Gail Porter"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-7646')) AND DATETIME(treatment.treatmenttime, 'start of year'...
eicu
CREATE TABLE table_51777 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the week for Result of w 28-17?
SELECT "Week" FROM table_51777 WHERE "Result" = 'w 28-17'
wikisql
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
SELECT zyjybgb.KSBM, zyjybgb.KSMC FROM zyjybgb WHERE zyjybgb.BGDH = '65189711033' UNION SELECT mzjybgb.KSBM, mzjybgb.KSMC FROM mzjybgb WHERE mzjybgb.BGDH = '65189711033'
css
CREATE TABLE table_41250 ( "Year" real, "Actor" text, "Award" text, "Series" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year gave a nominated result for the room 222 series?
SELECT COUNT("Year") FROM table_41250 WHERE "Result" = 'nominated' AND "Series" = 'room 222'
wikisql
CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Customer_Policies ( Policy_ID INTEGE...
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims) ORDER BY COUNT(Date_Claim_Made) DESC
nvbench
CREATE TABLE table_204_442 ( id number, "institution" text, "location" text, "enrollment" number, "nickname" text, "varsity\nsports" number, "rugby\nsince" text, "head coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who has the wol...
SELECT "institution" FROM table_204_442 WHERE "nickname" = 'wolfpack'
squall
CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, dat...
SELECT customer_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY customer_last_name DESC
nvbench
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2133" AND lab.label = "Hemoglobin"
mimicsql_data
CREATE TABLE college ( state VARCHAR, enr INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the states where have the colleges whose enrollments are less than the largest size.
SELECT DISTINCT state FROM college WHERE enr < (SELECT MAX(enr) FROM college)
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE fare_basis ( fare_basis_cod...
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, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND days.day_name = 'MONDAY' AND flight.flight_days = days.days_code AND ...
atis
CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Eve...
SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_Details DESC
nvbench
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT Posts.Id AS "post_link", Users.LastAccessDate, Posts.CreationDate, DATEDIFF(SECOND, Posts.CreationDate, LastAccessDate) AS timediff, * FROM Posts JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Posts.PostTypeId = 1 AND Posts.AnswerCount = 0 AND Posts.ClosedDate IS NULL AND CommentCount < 2 AND DATEDIFF(SECOND, ...
sede
CREATE TABLE table_25691838_2 ( the_wørd VARCHAR, original_airdate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the word for the episode that aired February 11?
SELECT the_wørd FROM table_25691838_2 WHERE original_airdate = "February 11"
sql_create_context
CREATE TABLE table_53026 ( "Name" text, "Real Name" text, "Birthdate" text, "Costume Role" text, "Defining characteristics" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the defining characteristic of Takeshi Kuroiwa?
SELECT "Defining characteristics" FROM table_53026 WHERE "Real Name" = 'takeshi kuroiwa'
wikisql
CREATE TABLE table_63695 ( "School" text, "City" text, "Team Name" text, "County" text, "Year Joined" text, "Year Left" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- From what county was the team that left the conference in 1993?
SELECT "County" FROM table_63695 WHERE "Year Left" = '1993'
wikisql
CREATE TABLE table_69193 ( "Round" real, "Circuit" text, "Date" text, "Fastest lap" text, "Winning driver" text, "Winning team" text, "Winning manufacturer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of Circuit Hockenhe...
SELECT "Date" FROM table_69193 WHERE "Circuit" = 'hockenheimring' AND "Winning manufacturer" = 'mercedes-benz'
wikisql
CREATE TABLE table_4761 ( "Couple" text, "Score" text, "Dance" text, "Music" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the team that danced a jive and was safe?
SELECT "Score" FROM table_4761 WHERE "Dance" = 'jive' AND "Result" = 'safe'
wikisql
CREATE TABLE table_name_87 ( result VARCHAR, week VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Result has a Week smaller than 11, and Attendance of 17,568?
SELECT result FROM table_name_87 WHERE week < 11 AND attendance = "17,568"
sql_create_context
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the ra...
SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_66 ( class VARCHAR, quantity_made VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Class has a Quantity made of 29?
SELECT class FROM table_name_66 WHERE quantity_made = "29"
sql_create_context
CREATE TABLE table_name_16 ( qual VARCHAR, grid VARCHAR, laps VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the total number of Qual Laps higher than 93 with a Rank of 32 with Grid less than 32
SELECT COUNT(qual) FROM table_name_16 WHERE laps > 93 AND rank = 32 AND grid < 32
sql_create_context
CREATE TABLE table_38840 ( "Name" text, "Type" text, "Entered service" text, "Water depth" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the water depth of Sedco 702, located in Nigeria?
SELECT "Water depth" FROM table_38840 WHERE "Location" = 'nigeria' AND "Name" = 'sedco 702'
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 WHERE demographic.gender = "M" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY"
mimicsql_data
CREATE TABLE table_name_25 ( bachelorette VARCHAR, season INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the bachelorette after season 8?
SELECT bachelorette FROM table_name_25 WHERE season > 8
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE qtb ( 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 COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '9150592' AND qtb.IN_HOSP_DATE BETWEEN '2000-06-12' AND '2018-01-22' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '9150592' AND gyb.IN_HOSP_DATE BETWEEN '2000-06-12' AND '2018-01-22' UNION SELECT COUNT(*) FROM zyb WHERE zyb.MED_SER_ORG_NO = '9150592' AND ...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
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 = "45620" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_16224 ( "Week" real, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What week corresponds to the last one to be played at the memorial stadium?
SELECT MAX("Week") FROM table_16224 WHERE "Stadium" = 'Memorial Stadium'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "CATHOLIC" AND lab.label = "Protein, Total"
mimicsql_data
CREATE TABLE table_56584 ( "Unit" text, "Complement" text, "Killed" text, "Wounded" text, "Missing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Complement of Artillery Corps Units that had 0 off 0 men Killed or Wounded?
SELECT "Complement" FROM table_56584 WHERE "Killed" = '0 off 0 men' AND "Wounded" = '0 off 0 men' AND "Unit" = 'artillery corps'
wikisql
CREATE TABLE table_name_36 ( martin VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What martin is on july 8 9, 2008?
SELECT martin FROM table_name_36 WHERE date = "july 8–9, 2008"
sql_create_context
CREATE TABLE table_17366 ( "Country" text, "Preliminaries" text, "Interview" text, "Swimsuit" text, "Evening Gown" text, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the preliminaries with average being 9.360
SELECT "Preliminaries" FROM table_17366 WHERE "Average" = '9.360'
wikisql
CREATE TABLE table_25691838_12 ( guest VARCHAR, original_airdate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the guests for the episode with an original airdate of december 07?
SELECT guest FROM table_25691838_12 WHERE original_airdate = "December 07"
sql_create_context
CREATE TABLE table_22073745_1 ( languages VARCHAR, original_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many languages have le roman de renart as the original title?
SELECT COUNT(languages) FROM table_22073745_1 WHERE original_title = "Le Roman de Renart"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "3897"
mimicsql_data
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "Albumin"
mimicsql_data
CREATE TABLE table_30120633_1 ( area__acres__ VARCHAR, poor_law_union VARCHAR, townland VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many acres does the area of Lissagroom with Bandon as its poor law union cover?
SELECT area__acres__ FROM table_30120633_1 WHERE poor_law_union = "Bandon" AND townland = "Lissagroom"
sql_create_context
CREATE TABLE table_78807 ( "Geelong DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average of wins when the byes are less than 0?
SELECT AVG("Wins") FROM table_78807 WHERE "Byes" < '0'
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 zzmzjzjlb.ZZYSGH, zzmzjzjlb.QTJZYSGH FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '67977476641' UNION SELECT fzzmzjzjlb.ZZYSGH, fzzmzjzjlb.QTJZYSGH FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '67977476641'
css
CREATE TABLE table_name_81 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was Wimbledon the home team?
SELECT date FROM table_name_81 WHERE home_team = "wimbledon"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiod...
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-3162')) AND STRFTIME('%y', allergy.allergytime) >= '2105'
eicu
CREATE TABLE table_train_200 ( "id" int, "gender" string, "fasting_triglycerides" int, "fasting_plasma_glucose" int, "smoking" bool, "body_mass_index_bmi" float, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- body m...
SELECT * FROM table_train_200 WHERE body_mass_index_bmi >= 22 AND body_mass_index_bmi <= 41
criteria2sql
CREATE TABLE table_31705 ( "Pos." text, "Driver" text, "Constructor" text, "Part 1" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the constructor for david coulthard
SELECT "Constructor" FROM table_31705 WHERE "Driver" = 'david coulthard'
wikisql
CREATE TABLE table_name_33 ( overall INTEGER, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Overall is the lowest one that has a Position of offensive tackle?
SELECT MIN(overall) FROM table_name_33 WHERE position = "offensive tackle"
sql_create_context
CREATE TABLE table_12186237_1 ( circuit VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What circuit was on the date 4 May?
SELECT circuit FROM table_12186237_1 WHERE date = "4 May"
sql_create_context
CREATE TABLE table_65813 ( "Position" text, "Gymnast" text, "A Score" real, "B Score" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the position for the competitor that has a score more than 7
SELECT "Position" FROM table_65813 WHERE "A Score" > '7'
wikisql
CREATE TABLE tasks ( task_id number, project_id number, task_details text, eg agree objectives text ) CREATE TABLE organisations ( organisation_id number, organisation_type text, organisation_details text ) CREATE TABLE documents ( document_id number, document_type_code text, g...
SELECT role_code FROM project_staff WHERE date_from > '2003-04-19 15:06:20' AND date_to < '2016-03-15 00:33:18'
spider
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 COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '72...
css
CREATE TABLE table_12444503_1 ( lost_to_eventual_winner VARCHAR, lost_to_eventual_runner_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players lost to eventual winner in the season when ASC Jeanne d'Arc lost to eventual runner up?
SELECT COUNT(lost_to_eventual_winner) FROM table_12444503_1 WHERE lost_to_eventual_runner_up = "ASC Jeanne d'Arc"
sql_create_context