instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE... | SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_600 DESC | nvbench |
CREATE TABLE table_name_40 (
lost VARCHAR,
try_bonus VARCHAR,
points_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lost when the try bonus is 5, and points against is 298?
| SELECT lost FROM table_name_40 WHERE try_bonus = "5" AND points_against = "298" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id numbe... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 19428) AND icustays.outtime IS NULL) ... | mimic_iii |
CREATE TABLE table_45758 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT I... | SELECT "Team" FROM table_45758 WHERE "Date" = 'december 30' | wikisql |
CREATE TABLE table_17593 (
"Season" text,
"Serbian League Belgrade" text,
"Serbian League East" text,
"Serbian League Vojvodina" text,
"Serbian League West" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team was promoted in the Serbian League ... | SELECT "Serbian League East" FROM table_17593 WHERE "Serbian League Belgrade" = 'Kolubara' | wikisql |
CREATE TABLE table_2102714_1 (
archive VARCHAR,
run_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is he archive for the episode with a run time of 24:05?
| SELECT archive FROM table_2102714_1 WHERE run_time = "24:05" | sql_create_context |
CREATE TABLE table_66228 (
"!Event" real,
"Round" text,
"Surface" text,
"Winner" text,
"Opponent" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many events did clay win?
| SELECT COUNT("!Event") FROM table_66228 WHERE "Winner" = 'clay' | wikisql |
CREATE TABLE table_17456 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many teams did Bob Peppler play for?
| SELECT COUNT("NHL team") FROM table_17456 WHERE "Player" = 'Bob Peppler' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '潘和正' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-11-28' AND '2019-10-22' AND t_kc24.MED_AMOUT <= 10 | css |
CREATE TABLE table_22076 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- HOw many point... | SELECT MAX("Points") FROM table_22076 WHERE "Goals scored" = '47' | wikisql |
CREATE TABLE table_40581 (
"Spoofed Title" text,
"Actual Title" text,
"Writer" text,
"Artist" text,
"Issue" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Writer with a Date that is january 1975?
| SELECT "Writer" FROM table_40581 WHERE "Date" = 'january 1975' | wikisql |
CREATE TABLE table_47310 (
"Year" text,
"Indians admitted" real,
"Pakistanis admitted" real,
"Sri Lankans admitted" real,
"Bangladeshis admitted" real,
"Nepalis admitted" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the most Nepalis a... | SELECT MAX("Nepalis admitted") FROM table_47310 WHERE "Sri Lankans admitted" > '5,520' AND "Bangladeshis admitted" > '2,715' AND "Pakistanis admitted" > '139,574' | wikisql |
CREATE TABLE table_16136 (
"Sepal length" text,
"Sepal width" text,
"Petal length" text,
"Petal width" text,
"Species" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of species with sepal width of 3.4 and sepal length of 5.4
| SELECT COUNT("Species") FROM table_16136 WHERE "Sepal width" = '3.4' AND "Sepal length" = '5.4' | wikisql |
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_by_staff_id INTEGER,
fault_log_entry_datetime DATETIME,
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Skills_Required_To_Fix (
part_fault_id INTEGER,
skill_id INTEGER
)
CRE... | SELECT last_name, COUNT(last_name) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY last_name ORDER BY last_name DESC | nvbench |
CREATE TABLE Allergy_type (
allergytype VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different allergy types exist?
| SELECT COUNT(DISTINCT allergytype) FROM Allergy_type | sql_create_context |
CREATE TABLE table_name_6 (
attendance INTEGER,
away VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average attendance when marathon was the away team?
| SELECT AVG(attendance) FROM table_name_6 WHERE away = "marathon" | sql_create_context |
CREATE TABLE table_53800 (
"Conference" text,
"Division" text,
"Appearances" real,
"Wins" real,
"Losses" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many losses did the division who appeared less than 16 times have?
| SELECT "Losses" FROM table_53800 WHERE "Appearances" < '16' | wikisql |
CREATE TABLE table_1658 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What wa... | SELECT "Location Attendance" FROM table_1658 WHERE "Date" = 'December 9' | wikisql |
CREATE TABLE table_name_46 (
title VARCHAR,
artist VARCHAR,
cat__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of the record with an artist of Tangorodrim, category number FSR006?
| SELECT title FROM table_name_46 WHERE artist = "tangorodrim" AND cat__number = "fsr006" | sql_create_context |
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
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_host... | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality DESC | nvbench |
CREATE TABLE table_name_40 (
result VARCHAR,
record VARCHAR,
game VARCHAR,
streak VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Result has a Game smaller than 37, and a Streak of lost 1, and a Record of 4-9?
| SELECT result FROM table_name_40 WHERE game < 37 AND streak = "lost 1" AND record = "4-9" | sql_create_context |
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 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-23724')) ORDER BY microlab.culturetakentime LIMIT 1 | eicu |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT Id AS "user_link", Reputation, CreationDate, LastAccessDate FROM Users WHERE AboutMe LIKE '%##text##%' | sede |
CREATE TABLE table_19870086_24 (
rank VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the rank of adam gilchrist
| SELECT COUNT(rank) FROM table_19870086_24 WHERE player = "Adam Gilchrist" | sql_create_context |
CREATE TABLE table_20545 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written By" text,
"Originalairdate" text,
"TV Broadcast" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which title was No. 4 in season... | SELECT "Title" FROM table_20545 WHERE "No. in season" = '4' | wikisql |
CREATE TABLE table_61653 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE 2011 WITH 2007 AT A AND2 008 A... | SELECT "2011" FROM table_61653 WHERE "2007" = 'a' AND "2008" = '3r' | wikisql |
CREATE TABLE mzb (
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_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '42705253' AND qtb.IN_HOSP_DATE BETWEEN '2016-09-13' AND '2017-01-15' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '42705253' AND gyb.IN_HOSP_DATE BETWEEN '2016-09-13' AND '2017-01-15' G... | css |
CREATE TABLE table_11654169_1 (
area_in_1000km²__1930_ VARCHAR,
voivodeship_separate_city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all areas within 1000 km in the city of Lubelskie?
| SELECT area_in_1000km²__1930_ FROM table_11654169_1 WHERE voivodeship_separate_city = "lubelskie" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,... | SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
Cr... | SELECT Id AS "post_link", Score, ViewCount AS "views", OwnerUserId AS "asker", CreationDate AS "asked", ClosedDate AS "closed", LastEditDate AS "edited", CASE WHEN LastEditDate > ClosedDate THEN 'yes' ELSE 'no' END AS "edited_after_close?" FROM Posts WHERE NOT ClosedDate IS NULL AND Id IN (SELECT DISTINCT PostId FROM C... | sede |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS... | SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY SUM(STU_GPA) DESC | nvbench |
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.
-- the total number of medals won by south africa was how many ?
| SELECT "total" FROM table_203_61 WHERE "nation" = 'south africa' | squall |
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 jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZ... | css |
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 School_ID, ACC_Percent FROM basketball_match GROUP BY All_Road | nvbench |
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 All_Home, ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE table_name_19 (
silver INTEGER,
nation VARCHAR,
total VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Silver when the total is less than 6, the rank is 6 and the Bulgaria is the nation?
| SELECT SUM(silver) FROM table_name_19 WHERE total < "6" AND rank = "6" AND nation = "bulgaria" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "18077" | mimicsql_data |
CREATE TABLE table_3563 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many season... | SELECT COUNT("Podiums") FROM table_3563 WHERE "Team" = 'Carlin' | wikisql |
CREATE TABLE table_53835 (
"Year" text,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Distance" text,
"Time" text,
"Purse" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the owner of the Raglan Road winner?
| SELECT "Owner" FROM table_53835 WHERE "Winner" = 'raglan road' | wikisql |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY Sex DESC | nvbench |
CREATE TABLE table_name_18 (
code__iata_icao_ VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the code for rank 10?
| SELECT code__iata_icao_ FROM table_name_18 WHERE rank = 10 | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
... | SELECT p.Id, p.Body FROM Posts AS p WHERE p.Body LIKE '%http://%.jpg%' AND (NOT p.Body LIKE '%]: http://%' AND NOT p.Body LIKE '%<img src=%') | sede |
CREATE TABLE table_24208 (
"Order" real,
"Couple" text,
"Karen" text,
"Nicky" text,
"Jason" text,
"Ruthie" text,
"Robin" text,
"Total" text,
"Scoreboard" text,
"Song" text,
"Public Vote %" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for t... | SELECT "Jason" FROM table_24208 WHERE "Public Vote %" = '19.20%' | wikisql |
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 WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "89" | mimicsql_data |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '秦娟丽' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 8902.92) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '秦娟丽' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUN... | css |
CREATE TABLE table_10757 (
"Year" real,
"Location" text,
"Champion" text,
"Second" text,
"Third" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In Winterberg, who was 3rd the year that Monique Riekewald was 2nd?
| SELECT "Third" FROM table_10757 WHERE "Location" = 'winterberg' AND "Second" = 'monique riekewald' | wikisql |
CREATE TABLE airports (
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the cities which have more than one airport and number of airports.
| SELECT city, COUNT(*) FROM airports GROUP BY city HAVING COUNT(*) > 1 | sql_create_context |
CREATE TABLE table_72258 (
"Year" real,
"Premier One" text,
"Premier Two" text,
"Bristol & Somerset" text,
"Glos & Wilts" text,
"Bristol & N. Som" text,
"Somerset" text,
"Gloucestershire" text,
"Wiltshire" text
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT "Bristol & N. Som" FROM table_72258 WHERE "Somerset" = 'Ashcott and Shapwick' | wikisql |
CREATE TABLE table_19160 (
"Year" real,
"1st District" text,
"2nd District" text,
"3rd District" text,
"4th District" text,
"5th District" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the last year that Howard A. Wassum was in the 5th ... | SELECT MAX("Year") FROM table_19160 WHERE "5th District" = 'Howard A. Wassum' | wikisql |
CREATE TABLE table_name_69 (
margin_of_victory VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the margin of victory on Mar 18, 1979?
| SELECT margin_of_victory FROM table_name_69 WHERE date = "mar 18, 1979" | sql_create_context |
CREATE TABLE HOTELS (
price_range INTEGER,
star_rating_code VARCHAR,
pets_allowed_yn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the average price range of hotels that have 5 star ratings and allow pets.
| SELECT AVG(price_range) FROM HOTELS WHERE star_rating_code = "5" AND pets_allowed_yn = 1 | sql_create_context |
CREATE TABLE table_25561560_3 (
yacht VARCHAR,
skipper VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What yacht did Andrew Saies sail on?
| SELECT yacht FROM table_25561560_3 WHERE skipper = "Andrew Saies" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE jyjgzbb.JYRQ BETWEEN '2001-10-27' AND '2007-12-0... | css |
CREATE TABLE table_65323 (
"Year" real,
"Record" text,
"Finish" text,
"Manager" text,
"Playoffs" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Record has a Year larger than 1974, and a Finish of 3rd?
| SELECT "Record" FROM table_65323 WHERE "Year" > '1974' AND "Finish" = '3rd' | wikisql |
CREATE TABLE table_743 (
"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.
-- What was the result of the election of the incumbent clyde doyle?
| SELECT "Result" FROM table_743 WHERE "Incumbent" = 'Clyde Doyle' | wikisql |
CREATE TABLE table_53089 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the home team score when the away team is south melbourne
| SELECT "Home team score" FROM table_53089 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE table_8228 (
"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 whole of Drawn that has a Played larger than 14?
| SELECT SUM("Drawn") FROM table_8228 WHERE "Played" > '14' | wikisql |
CREATE TABLE table_203_330 (
id number,
"year of election" number,
"candidates elected" number,
"# of seats available" number,
"# of votes" number,
"% of popular vote" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- year with largest number of ca... | SELECT "year of election" FROM table_203_330 ORDER BY "candidates elected" DESC LIMIT 1 | squall |
CREATE TABLE table_train_178 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"hiv_infection" bool,
"hepatitis_c" bool,
"renal_disease" bool,
"hypoglycemia" bool,
"serum_creatinine" float,
"seizure_disorder" bool,
"body_mass_index_bmi" float,
"NOUSE" float
)
-- U... | SELECT * FROM table_train_178 WHERE hypoglycemia = 1 OR seizure_disorder = 1 | criteria2sql |
CREATE TABLE table_name_13 (
tournament VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Tournament had a Score of 6 3, 2 6, 6 3?
| SELECT tournament FROM table_name_13 WHERE score = "6–3, 2–6, 6–3" | sql_create_context |
CREATE TABLE table_54887 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament in 2013 ... | SELECT "2013" FROM table_54887 WHERE "2006" = 'a' AND "2010" = '1r' | wikisql |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT course.department, course.name, course.number 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 WHERE program_cour... | advising |
CREATE TABLE table_name_33 (
band INTEGER,
power__w_ INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Band's Power (W) is 400 or less?
| SELECT MAX(band) FROM table_name_33 WHERE power__w_ > 400 | sql_create_context |
CREATE TABLE table_name_47 (
drawn VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the drawn value for furnace united rfc?
| SELECT drawn FROM table_name_47 WHERE club = "furnace united rfc" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT demographic.age, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "52118" | mimicsql_data |
CREATE TABLE table_39299 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has Opponents in the final of valeria... | SELECT "Date" FROM table_39299 WHERE "Opponents in the final" = 'valeria casillo lilly raffa' | wikisql |
CREATE TABLE table_name_16 (
money___ INTEGER,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most money for the score 75-74-72-67=288?
| SELECT MAX(money___) AS $__ FROM table_name_16 WHERE score = 75 - 74 - 72 - 67 = 288 | sql_create_context |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
C... | SELECT DISTINCT flight_id FROM flight WHERE (((((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 26 AND DATE_DAYalias0.month_number = 7 AND DATE_DAYalias0.year = 1991)) AND ... | atis |
CREATE TABLE table_name_73 (
team__number1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the team Unics Kazan's 1st leg score?
| SELECT 1 AS st_leg FROM table_name_73 WHERE team__number1 = "unics kazan" | sql_create_context |
CREATE TABLE table_name_62 (
bronze INTEGER,
total VARCHAR,
gold VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the Bronze medals when the Gold medals are larger than 0, Silver medals are smaller than 1, and the tot... | SELECT SUM(bronze) FROM table_name_62 WHERE gold > 0 AND silver < 1 AND total < 1 | sql_create_context |
CREATE TABLE table_15717093_1 (
title VARCHAR,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title when there were 14.39 million viewers?
| SELECT title FROM table_15717093_1 WHERE us_viewers__millions_ = "14.39" | sql_create_context |
CREATE TABLE table_name_98 (
league_cup_goals INTEGER,
total_apps VARCHAR,
fa_cup_apps VARCHAR,
league_cup_apps VARCHAR,
league_goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the average league cup goals when the league cup apps is ... | SELECT AVG(league_cup_goals) FROM table_name_98 WHERE league_cup_apps = 4 AND league_goals < 4 AND fa_cup_apps = "1" AND total_apps = "35" | sql_create_context |
CREATE TABLE table_69607 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament has a 2007 of 2r, and a 2011 of 2r?
| SELECT "Tournament" FROM table_69607 WHERE "2007" = '2r' AND "2011" = '2r' | wikisql |
CREATE TABLE table_name_69 (
position VARCHAR,
team_from VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position of the team player from Aik?
| SELECT position FROM table_name_69 WHERE team_from = "aik" | sql_create_context |
CREATE TABLE table_name_93 (
year_born__age_ VARCHAR,
height VARCHAR,
current_club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Year born (Age) for the player who is taller than 2.04 and currently plays for the Los Angeles Clippers?
| SELECT year_born__age_ FROM table_name_93 WHERE height > 2.04 AND current_club = "los angeles clippers" | sql_create_context |
CREATE TABLE table_name_70 (
games VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which game is named tsegay kebede category:articles with hcards?
| SELECT games FROM table_name_70 WHERE name = "tsegay kebede category:articles with hcards" | sql_create_context |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
c... | SELECT card_type_code, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code ORDER BY SUM(card_number) DESC | nvbench |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE | nvbench |
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE dorm_amenity (
amenid number,
... | SELECT fname, lname FROM student WHERE major <> (SELECT major FROM student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1) | spider |
CREATE TABLE table_16244 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Featured character(s)" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "Directed by" FROM table_16244 WHERE "U.S. viewers (million)" = '12.90' | wikisql |
CREATE TABLE table_17323042_11 (
high_assists VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the High Assist in game 1?
| SELECT high_assists FROM table_17323042_11 WHERE game = 1 | sql_create_context |
CREATE TABLE VOTING_RECORD (
Secretary_Vote VARCHAR,
ELECTION_CYCLE VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the distinct secretary votes in the fall election cycle?
| SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = "Fall" | sql_create_context |
CREATE TABLE table_name_98 (
first_elected VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the first elected date for the incumbent in the South Carolina 4 district?
| SELECT first_elected FROM table_name_98 WHERE district = "south carolina 4" | sql_create_context |
CREATE TABLE table_1849243_1 (
viewers__in_millions_ VARCHAR,
run_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many viewers in millions watched the episode 23:55 minutes long?
| SELECT viewers__in_millions_ FROM table_1849243_1 WHERE run_time = "23:55" | sql_create_context |
CREATE TABLE table_name_53 (
district VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What District has a Location of villupuram?
| SELECT district FROM table_name_53 WHERE location = "villupuram" | sql_create_context |
CREATE TABLE table_name_80 (
silver INTEGER,
bronze VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the low silver medal total for nations with over 1 bronze ranked above 11?
| SELECT MIN(silver) FROM table_name_80 WHERE bronze > 1 AND rank < 11 | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semest... | SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 200 AND 200 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_offering.semester... | advising |
CREATE TABLE table_71735 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is on at 9:30 on the channel of dancing with the stars?
| SELECT "9:30" FROM table_71735 WHERE "8:30" = 'dancing with the stars' | wikisql |
CREATE TABLE region (
region_name VARCHAR,
Label VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all distinct region names ordered by their labels.
| SELECT DISTINCT region_name FROM region ORDER BY Label | sql_create_context |
CREATE TABLE table_19482 (
"Pick #" real,
"NFL 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 the player whose college is Florida State?
| SELECT "Pick #" FROM table_19482 WHERE "College" = 'Florida State' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '许兰梦' AND jy... | css |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE aircraft (
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 27 AND date_day.month_number = 8... | atis |
CREATE TABLE table_name_88 (
grid INTEGER,
laps VARCHAR,
time_retired VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the lowest grid when the time retired is clutch, the driver is peter collins and the laps is smaller than 26?... | SELECT MIN(grid) FROM table_name_88 WHERE time_retired = "clutch" AND driver = "peter collins" AND laps < 26 | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE... | SELECT MANAGER_ID, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text... | SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '4651944' AND BGRQ BETWEEN '2006-10-08' AND '2007-11-01' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL) LIMIT 1 | css |
CREATE TABLE table_name_87 (
round VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of rounds of the player with a pick of 20?
| SELECT COUNT(round) FROM table_name_87 WHERE pick = 20 | 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 Users (
Id number,
Reputation number,... | SELECT DISTINCT qtns.Id, qtns.Title, qtns.CreationDate, CASE WHEN qtns.AcceptedAnswerId = ans.Id THEN 'Yes' ELSE 'No' END AS Accepted FROM Posts AS qtns JOIN Posts AS ans ON qtns.Id = ans.ParentId WHERE qtns.OwnerUserId = @QtnsUser AND ans.OwnerUserId = @AnsUser ORDER BY qtns.CreationDate | sede |
CREATE TABLE table_name_13 (
points VARCHAR,
tries_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Points with a Tries For that is 21?
| SELECT points FROM table_name_13 WHERE tries_for = "21" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
Par... | SELECT PL.RelatedPostId AS "post_link", COUNT(*) AS LinkScore FROM PostLinks AS PL INNER JOIN Posts AS PS ON PS.Id = PL.PostId INNER JOIN Posts AS PT ON PT.ParentId = PL.RelatedPostId WHERE PL.LinkTypeId = 3 AND PT.OwnerUserId = '##UserId?2751851##' GROUP BY PL.RelatedPostId ORDER BY LinkScore DESC | sede |
CREATE TABLE table_1733457_1 (
kerry_number INTEGER,
others_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the maximum kerry # for where others is 47
| SELECT MAX(kerry_number) FROM table_1733457_1 WHERE others_number = 47 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.