instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_204_986 (
id number,
"#" number,
"event year" number,
"season" text,
"flag bearer" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of years ele opeloge was the samoa flag bearer at the olympics ?
| SELECT COUNT("event year") FROM table_204_986 WHERE "flag bearer" = 'ele opeloge' | squall |
CREATE TABLE table_74583 (
"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 is the average crowd size when Collingwood ... | SELECT AVG("Crowd") FROM table_74583 WHERE "Away team" = 'collingwood' | wikisql |
CREATE TABLE table_61815 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest Against with a Date of 18/02/1989?
| SELECT MIN("Against") FROM table_61815 WHERE "Date" = '18/02/1989' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id num... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) ... | mimic_iii |
CREATE TABLE table_53052 (
"Code" real,
"Type" text,
"Name" text,
"Area (km 2 )" real,
"Population" real,
"Regional County Municipality" text,
"Region" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest region number with a 4... | SELECT MAX("Region") FROM table_53052 WHERE "Population" = '499' | wikisql |
CREATE TABLE table_16782 (
"No. in series" real,
"No. in season" real,
"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.
-- How many titles we... | SELECT COUNT("Directed by") FROM table_16782 WHERE "No. in series" = '79' | wikisql |
CREATE TABLE table_11874 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what venue was the 1978 FIFA world cup qualification played in?
| SELECT "Venue" FROM table_11874 WHERE "Competition" = '1978 fifa world cup qualification' | wikisql |
CREATE TABLE products (
product_id number,
product_name text,
product_details text
)
CREATE TABLE shipment_items (
shipment_id number,
order_item_id number
)
CREATE TABLE order_items (
order_item_id number,
product_id number,
order_id number,
order_item_status text,
order_item_... | SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452" | spider |
CREATE TABLE table_204_532 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- where did they place the last season ?
| SELECT "place" FROM table_204_532 ORDER BY "season" DESC LIMIT 1 | squall |
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 demographic.discharge_location, demographic.dischtime FROM demographic WHERE demographic.name = "Thomas Nazario" | mimicsql_data |
CREATE TABLE table_name_88 (
founded INTEGER,
joined INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average founded with joined less than 2008
| SELECT AVG(founded) FROM table_name_88 WHERE joined < 2008 | sql_create_context |
CREATE TABLE table_name_82 (
ihsaa_class VARCHAR,
_number___county VARCHAR,
mascot VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the IHSAA class with county 18 delaware and tigers mascot
| SELECT ihsaa_class FROM table_name_82 WHERE _number___county = "18 delaware" AND mascot = "tigers" | sql_create_context |
CREATE TABLE table_204_438 (
id number,
"year" number,
"title" text,
"album" text,
"us r&b" number,
"us pop" number,
"us dance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the difference in r & b ranking between come go with me... | SELECT ABS((SELECT "us r&b" FROM table_204_438 WHERE "title" = '"come go with me"') - (SELECT "us r&b" FROM table_204_438 WHERE "title" = '"dance 4 me"')) | squall |
CREATE TABLE table_name_45 (
country VARCHAR,
previous_team__league_ VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Country, when Previous Team (League) is 'Kingston Frontenacs ( OHL )', and when Player is 'Anthony Stewart Categor... | SELECT country FROM table_name_45 WHERE previous_team__league_ = "kingston frontenacs ( ohl )" AND player = "anthony stewart category:articles with hcards" | sql_create_context |
CREATE TABLE table_41629 (
"Name" text,
"Career" text,
"Goals" real,
"Appearances" real,
"Goals/Game Ratio" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which goals/game ratio has fewer than 201 goals and fewer than 170 appearances?
| SELECT "Goals/Game Ratio" FROM table_41629 WHERE "Goals" < '201' AND "Appearances" < '170' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,... | SELECT edit.PostId, edit.Id AS "suggested_edit_link" FROM SuggestedEditVotes AS vote, SuggestedEdits AS edit WHERE vote.UserId = @UserId AND vote.SuggestedEditId = edit.Id AND (NOT edit.ApprovalDate IS NULL AND vote.VoteTypeId = 3 OR NOT edit.RejectionDate IS NULL AND vote.VoteTypeId = 2) | sede |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | 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 table_2328113_1 (
population__2011_ INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the minimum population in 2011?
| SELECT MIN(population__2011_) FROM table_2328113_1 | sql_create_context |
CREATE TABLE music_festival (
Date_of_ceremony VARCHAR,
Category VARCHAR,
RESULT VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the date of ceremony of music festivals with category 'Best Song' and result 'Awarded'?
| SELECT Date_of_ceremony FROM music_festival WHERE Category = "Best Song" AND RESULT = "Awarded" | sql_create_context |
CREATE TABLE table_59980 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Country of the Player in Place 1?
| SELECT "Country" FROM table_59980 WHERE "Place" = '1' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGu... | SELECT u.Id, u.DisplayName, u.Reputation, u.WebsiteUrl, u.Age, u.LastAccessDate, u.Location FROM Users AS u WHERE (LOWER(u.Location) LIKE LOWER('##Location:string##')) OR (LOWER(u.Location) LIKE LOWER('##AltLocation:string##')) OR (LOWER(u.Location) LIKE LOWER('##AltLocation2:string##')) ORDER BY u.Reputation DESC LIMI... | sede |
CREATE TABLE table_41301 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponent in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament was played on 12 February 2001?
| SELECT "Tournament" FROM table_41301 WHERE "Date" = '12 february 2001' | wikisql |
CREATE TABLE table_56788 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the leading scorer when they were at home of the Clip... | SELECT "Leading scorer" FROM table_56788 WHERE "Home" = 'clippers' | wikisql |
CREATE TABLE table_name_10 (
prize VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Prize, when the Event is Ept Deauville?
| SELECT prize FROM table_name_10 WHERE event = "ept deauville" | sql_create_context |
CREATE TABLE table_34022 (
"Rank" text,
"City" text,
"Population" real,
"Area (km 2 )" real,
"Density (inhabitants/km 2 )" real,
"Altitude (mslm)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest density of alessandria where the... | SELECT MIN("Density (inhabitants/km 2 )") FROM table_34022 WHERE "Area (km 2 )" > '16.02' AND "Altitude (mslm)" < '116' AND "City" = 'alessandria' | wikisql |
CREATE TABLE table_name_65 (
surface VARCHAR,
round VARCHAR,
edition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the surface when the round is gii play-offs and the edition is 2009 fed cup europe/africa group ii?
| SELECT surface FROM table_name_65 WHERE round = "gii play-offs" AND edition = "2009 fed cup europe/africa group ii" | sql_create_context |
CREATE TABLE table_name_35 (
laps VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps were there for a grid of 13?
| SELECT COUNT(laps) FROM table_name_35 WHERE grid = 13 | sql_create_context |
CREATE TABLE table_3381 (
"Episode #" real,
"The W\u00f8rd" text,
"Guest" text,
"Introductory phrase" text,
"Original airdate" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the number of 'The Word' segments for ... | SELECT COUNT("The W\u00f8rd") FROM table_3381 WHERE "Episode #" = '727' | wikisql |
CREATE TABLE table_203_695 (
id number,
"draw" number,
"artist" text,
"song" text,
"points" number,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which was the only song to earn less than 60 points ?
| SELECT "song" FROM table_203_695 WHERE "points" < 60 | squall |
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
... | SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller ORDER BY COUNT(Comptroller) DESC | nvbench |
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 AVG(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_AGE >= 20) | css |
CREATE TABLE furniture (
name VARCHAR,
furniture_id VARCHAR,
market_rate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return the name and id of the furniture with the highest market rate.
| SELECT name, furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_31015 (
"Team" text,
"Contest and round" text,
"Opponent" text,
"1st leg score*" text,
"2nd leg score**" text,
"Aggregate score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the name of the team opponent to elfsborg... | SELECT "Team" FROM table_31015 WHERE "Opponent" = 'Elfsborg' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2110" AND diagnoses.short_title = "Cholelith/ac gb inf-obst" | mimicsql_data |
CREATE TABLE table_name_46 (
country VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the country for pieroni
| SELECT country FROM table_name_46 WHERE name = "pieroni" | sql_create_context |
CREATE TABLE table_69027 (
"Appearances" real,
"Team" text,
"Wins" real,
"Losses" real,
"Winning percentage" real,
"Season(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In 2009, what Appearances had a Winning Percentage of less than 0?
| SELECT AVG("Appearances") FROM table_69027 WHERE "Season(s)" = '2009' AND "Winning percentage" < '0' | wikisql |
CREATE TABLE table_9807 (
"Rank" real,
"Title" text,
"Studio" text,
"Director" text,
"Worldwide Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What studio is director Reginald Hudlin from?
| SELECT "Studio" FROM table_9807 WHERE "Director" = 'reginald hudlin' | wikisql |
CREATE TABLE table_44094 (
"Usage" text,
"Class" text,
"Performance" text,
"Performance test" text,
"Particulate size approaching 100% retention" text,
"Test Standard" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Test Standard has a Usag... | SELECT "Test Standard" FROM table_44094 WHERE "Usage" = 'secondary filters' AND "Class" = 'f5' | wikisql |
CREATE TABLE table_name_38 (
year_started INTEGER,
current_car VARCHAR,
number_of_cars VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year started is the highest one that has a Current car of arctic sun, and a Number of cars smaller than 1?
| SELECT MAX(year_started) FROM table_name_38 WHERE current_car = "arctic sun" AND number_of_cars < 1 | sql_create_context |
CREATE TABLE flight (
id int,
Vehicle_Flight_number text,
Date text,
Pilot text,
Velocity real,
Altitude real,
airport_id int,
company_id int
)
CREATE TABLE operate_company (
id int,
name text,
Type text,
Principal_activities text,
Incorporated_in text,
Group_Equ... | SELECT Type, COUNT(Type) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY Type ORDER BY Type | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT demographic.dod FROM demographic WHERE demographic.name = "Paul Edwards" | 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 WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.age < "20" | mimicsql_data |
CREATE TABLE table_65835 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Gold medals for the Nations with 6 or more Bronze medals and 18 or more Silver?
| SELECT AVG("Gold") FROM table_65835 WHERE "Bronze" > '6' AND "Silver" > '18' | wikisql |
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 gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9841208' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '98412... | css |
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 demographic.marital_status, demographic.dob FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_60255 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number against on 12/04/1969?
| SELECT MAX("Against") FROM table_60255 WHERE "Date" = '12/04/1969' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "UPPER GI BLEED" AND procedures.icd9_code = "66" | mimicsql_data |
CREATE TABLE table_21058823_1 (
result VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What did they do in the game when their record was 3-2-1?
| SELECT result FROM table_21058823_1 WHERE record = "3-2-1" | sql_create_context |
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE region (
Region_id int,
Region_code text,
R... | SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 | nvbench |
CREATE TABLE table_name_92 (
score VARCHAR,
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the Boston Bruins away game on March 13?
| SELECT score FROM table_name_92 WHERE visitor = "boston bruins" AND date = "march 13" | sql_create_context |
CREATE TABLE table_56443 (
"Rank" real,
"Movie" text,
"Year" real,
"Studio(s)" text,
"Opening Day Net Gross" real,
"Day of Week" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average rank of the Reliance Entertainment movie with an ... | SELECT AVG("Rank") FROM table_56443 WHERE "Day of Week" = 'wednesday' AND "Year" < '2012' AND "Studio(s)" = 'reliance entertainment' | wikisql |
CREATE TABLE table_name_79 (
swimsuit INTEGER,
average VARCHAR,
interview VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Swimsuit scores where the average score is 9.733 and the interview score is higher than 9.654?
| SELECT SUM(swimsuit) FROM table_name_79 WHERE average = 9.733 AND interview > 9.654 | sql_create_context |
CREATE TABLE table_name_44 (
cuts_made VARCHAR,
events VARCHAR,
top_25 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of cuts made for events played more than 3 times and under 2 top-25s?
| SELECT COUNT(cuts_made) FROM table_name_44 WHERE events > 3 AND top_25 < 2 | sql_create_context |
CREATE TABLE table_52963 (
"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.
-- Which away team scored 10.14 (74)?
| SELECT "Away team" FROM table_52963 WHERE "Away team score" = '10.14 (74)' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
Creati... | SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS PeriodRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS Questions, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND ... | sede |
CREATE TABLE table_1473672_4 (
college_junior_club_team VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the college/junior club team for pick number 63
| SELECT college_junior_club_team FROM table_1473672_4 WHERE pick__number = 63 | sql_create_context |
CREATE TABLE table_name_27 (
byes INTEGER,
draws INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many byes were there recorded with 0 draws?
| SELECT SUM(byes) FROM table_name_27 WHERE draws < 0 | sql_create_context |
CREATE TABLE table_name_5 (
region VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Region, when the Catalog is SM 2965-05?
| SELECT region FROM table_name_5 WHERE catalog = "sm 2965-05" | sql_create_context |
CREATE TABLE table_57591 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is th... | SELECT "Tyre" FROM table_57591 WHERE "Pole position" = 'jerry hoyt' | wikisql |
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
-- Using valid SQLite, answer the ... | SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY Author | nvbench |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.icd9_code = "7596" | mimicsql_data |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =... | mimic_iii |
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 demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "10317" | mimicsql_data |
CREATE TABLE table_20799905_1 (
obama_percentage VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percentage did Obama get in Rutherford county?
| SELECT obama_percentage FROM table_20799905_1 WHERE county = "RUTHERFORD" | sql_create_context |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | (SELECT jybgb.SHSJ 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 jyb... | css |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id numbe... | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'insert gastric tube nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86791) AND DATETIME(procedu... | mimic_iii |
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.admission_type = "NEWBORN" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" | mimicsql_data |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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 varc... | SELECT HIRE_DATE, SUM(SALARY) FROM employees | nvbench |
CREATE TABLE table_train_191 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"diabetic" string,
"serum_creatinine" float,
"allergy_to_glyburide" bool,
"kidney_disease" bool,
"drug_abuse" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following q... | SELECT * FROM table_train_191 WHERE hemoglobin_a1c_hba1c >= 6 AND hemoglobin_a1c_hba1c <= 9.5 | criteria2sql |
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 Class, COUNT(Class) FROM captain GROUP BY Rank, Class ORDER BY COUNT(Class) DESC | nvbench |
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 jybgb.KSBM, jybgb.KSMC FROM jybgb WHERE jybgb.BGDH = '68651052326' | css |
CREATE TABLE table_47781 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team with 3305 in attendance?
| SELECT "Home" FROM table_47781 WHERE "Attendance" = '3305' | wikisql |
CREATE TABLE table_77411 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Player, when Place is '1'?
| SELECT "Player" FROM table_77411 WHERE "Place" = '1' | wikisql |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
A... | SELECT County_name, Population FROM county ORDER BY Population DESC | nvbench |
CREATE TABLE table_35396 (
"Ranking" real,
"Nationality" text,
"Name" text,
"Position" text,
"Years" text,
"League" real,
"Europe" real,
"Others" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the Eur... | SELECT SUM("Europe") FROM table_35396 WHERE "Others" = '0' AND "League" < '328' AND "Position" = 'mf' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40)... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_name_61 (
score VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which score has a Home Team of saskatoon accelerators?
| SELECT score FROM table_name_61 WHERE home_team = "saskatoon accelerators" | 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 PendingFlags (
Id number,
FlagTypeId number,
PostId number,
Creati... | SELECT LAST_DATE_OF_MONTH(v.CreationDate), COUNT(v.Id) AS "total_upvotes", SUM(CASE WHEN p.PostTypeId = 1 THEN 1 ELSE 0 END) AS "question_upvotes", SUM(CASE WHEN p.PostTypeId = 2 THEN 1 ELSE 0 END) AS "answer_upvotes" FROM Posts AS p INNER JOIN Votes AS v ON v.PostId = p.Id WHERE v.VoteTypeId = 2 AND (p.CommunityOwnedD... | sede |
CREATE TABLE table_train_271 (
"id" int,
"renal_disease" bool,
"hepatic_disease" bool,
"smoking" bool,
"coronary_artery_disease_cad" bool,
"serum_creatinine" float,
"body_mass_index_bmi" float,
"myocardial_infarction" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the followin... | SELECT * FROM table_train_271 WHERE coronary_artery_disease_cad = 1 OR myocardial_infarction = 1 | criteria2sql |
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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '3006208' AND t_kc24.t_kc21_MED_ORG_DEPT_NM = '小儿肛肠外科') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2020-05-01' AND '2020-11-26' | css |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
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 varch... | SELECT DISTINCT student.firstname, student.lastname FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = course... | advising |
CREATE TABLE table_59943 (
"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.
-- what is 2012 when the tournament is cincinnati masters?
| SELECT "2012" FROM table_59943 WHERE "Tournament" = 'cincinnati masters' | wikisql |
CREATE TABLE table_46548 (
"Name" text,
"Date" text,
"Defending forces" text,
"Brigade" text,
"Population" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Defending forces when the population was 120?
| SELECT "Defending forces" FROM table_46548 WHERE "Population" = '120' | wikisql |
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 t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '9266257' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_... | css |
CREATE TABLE table_26230 (
"No" real,
"Player" text,
"Height (m)" text,
"Height (f)" text,
"Position" text,
"Year born" real,
"Current Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Identify every player's height in meters if the playe... | SELECT "Height (m)" FROM table_26230 WHERE "Height (f)" = '6'' 07' | wikisql |
CREATE TABLE table_70437 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school in Balclutha has a roll smaller than 55?
| SELECT "Name" FROM table_70437 WHERE "Area" = 'balclutha' AND "Roll" < '55' | wikisql |
CREATE TABLE table_202_231 (
id number,
"party" text,
"votes" number,
"%" number,
"seats" number,
"+/-" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which party finished last in the election ?
| SELECT "party" FROM table_202_231 ORDER BY "%" LIMIT 1 | 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.JCFF FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.... | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT COUNT(*) FROM jybgb WHERE jybgb.JZLSH = '75590344936' | css |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE table_53777 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What driver has BRM as a constructor and had more than 30 laps?
| SELECT "Driver" FROM table_53777 WHERE "Constructor" = 'brm' AND "Laps" > '30' | wikisql |
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 COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_ID = '31926697' AND t_kc21.CLINIC_TYPE = '住院' AND MOD(t_kc21.MED_AMOUT, 1) = 0 | css |
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 * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '67921466' AND hz_info.YLJGDM = '0629805' AND zyjzjlb.CYKSMC LIKE '%化疗%' | css |
CREATE TABLE table_name_67 (
conference_joined VARCHAR,
location VARCHAR,
mascot VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Conference Joined that has the Location of terre haute, and the Mascot of golden bears?
| SELECT conference_joined FROM table_name_67 WHERE location = "terre haute" AND mascot = "golden bears" | sql_create_context |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TAB... | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'BURBANK' AND flight.airline_code = 'AS' AND flight.to_airport = airport_service.airport_code | atis |
CREATE TABLE table_49970 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times is the country united states and the score 72-71-73-73=289?
| SELECT COUNT("To par") FROM table_49970 WHERE "Country" = 'united states' AND "Score" = '72-71-73-73=289' | wikisql |
CREATE TABLE table_name_86 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score when november 15 is the date?
| SELECT score FROM table_name_86 WHERE date = "november 15" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.age < "45" | mimicsql_data |
CREATE TABLE table_76736 (
"School" text,
"Locality" text,
"Ages" text,
"Capacity" real,
"Ofsted" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is heaton chapel's capacity?
| SELECT MAX("Capacity") FROM table_76736 WHERE "Locality" = 'heaton chapel' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 49654 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.