instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_77 (
rounds VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which rounds did the team Walther participate in?
| SELECT rounds FROM table_name_77 WHERE team = "walther" | sql_create_context |
CREATE TABLE table_37636 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Attendance of 55,340 had what opponent?
| SELECT "Opponent" FROM table_37636 WHERE "Attendance" = '55,340' | wikisql |
CREATE TABLE table_6663 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record when the loss is westbrook (1-6)?
| SELECT "Record" FROM table_6663 WHERE "Loss" = 'westbrook (1-6)' | wikisql |
CREATE TABLE table_48381 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Position has a Pick # smaller than 23, and a Player of garrett sutherland?
| SELECT "Position" FROM table_48381 WHERE "Pick #" < '23' AND "Player" = 'garrett sutherland' | wikisql |
CREATE TABLE table_204_174 (
id number,
"rank" number,
"name" text,
"nationality" text,
"result" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many names are there ?
| SELECT COUNT("name") FROM table_204_174 | squall |
CREATE TABLE table_name_79 (
position VARCHAR,
first_team_goals VARCHAR,
current_club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position of the player who has ongoing first-team goals and currently plays for the Aston Villa club?
| SELECT position FROM table_name_79 WHERE first_team_goals = "ongoing" AND current_club = "aston villa" | 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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Vitamin D" | mimicsql_data |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimme... | SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_300 | nvbench |
CREATE TABLE table_29110 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer" text,
"Original Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote 'at the end of the aisle'?
| SELECT "Writer" FROM table_29110 WHERE "Title" = 'At The End of the Aisle' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type t... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 18866 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_name_16 (
bronze INTEGER,
total INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest bronze for less than 2 total trophies?
| SELECT MAX(bronze) FROM table_name_16 WHERE total < 2 | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "ENGL" AND demographic.age < "36" | mimicsql_data |
CREATE TABLE table_10357 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the racer that had a first qualification time of 1:22.085?
| SELECT "Name" FROM table_10357 WHERE "Qual 1" = '1:22.085' | wikisql |
CREATE TABLE certificate (
eid number,
aid number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
CREATE TABLE employee (
eid number,
name text,
salary number
)
... | SELECT T1.flno FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300" | spider |
CREATE TABLE table_204_887 (
id number,
"district" number,
"representative" text,
"party" text,
"residence" text,
"counties represented" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many senators represent natrona county ?
| SELECT COUNT("representative") FROM table_204_887 WHERE "counties represented" = 'natrona' | squall |
CREATE TABLE table_15229 (
"Rank" real,
"Heat" real,
"Lane" real,
"Nation" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what heat did the swimmer in Lane 6 rank higher than 7 with a time of 4:08.27?
| SELECT SUM("Heat") FROM table_15229 WHERE "Lane" = '6' AND "Time" = '4:08.27' AND "Rank" > '7' | wikisql |
CREATE TABLE table_name_58 (
debut VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What round was the debut of Scott Tunbridge?
| SELECT debut FROM table_name_58 WHERE name = "scott tunbridge" | sql_create_context |
CREATE TABLE theme_parks (
theme_park_id number,
theme_park_details text
)
CREATE TABLE ref_attraction_types (
attraction_type_code text,
attraction_type_description text
)
CREATE TABLE hotels (
hotel_id number,
star_rating_code text,
pets_allowed_yn text,
price_range number,
other... | SELECT how_to_get_there FROM tourist_attractions GROUP BY how_to_get_there ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_12672 (
"Mininera DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins for the team with more than 1282 against and fewer than 14 losses?
| SELECT MIN("Wins") FROM table_12672 WHERE "Against" > '1282' AND "Losses" < '14' | 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 t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '70715838' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '986663290') | css |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95088) AND prescriptions.route = 'ih' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m',... | mimic_iii |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJ... | css |
CREATE TABLE table_26275 (
"Name" text,
"Starting chip count" real,
"WSOP bracelets" real,
"WSOP cashes" real,
"WSOP earnings" text,
"Final place" text,
"Prize" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had 2 WSOP cashes and was 6th... | SELECT "Name" FROM table_26275 WHERE "WSOP cashes" = '2' AND "Final place" = '6th' | wikisql |
CREATE TABLE table_name_72 (
opponent VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Opponent that has the Time of 0:20?
| SELECT opponent FROM table_name_72 WHERE time = "0:20" | sql_create_context |
CREATE TABLE table_72696 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text,
"Pictorials" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the interview subject on the date 1-97?
| SELECT "Interview subject" FROM table_72696 WHERE "Date" = '1-97' | wikisql |
CREATE TABLE MediaType (
MediaTypeId integer,
Name varchar(120)
)
CREATE TABLE Invoice (
InvoiceId integer,
CustomerId integer,
InvoiceDate datetime,
BillingAddress varchar(70),
BillingCity varchar(40),
BillingState varchar(40),
BillingCountry varchar(40),
BillingPostalCode varc... | SELECT T1.Title, T1.AlbumId FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 ORDER BY T1.AlbumId | nvbench |
CREATE TABLE table_11734041_3 (
years_for_rockets VARCHAR,
no_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During which years did number 13 play for the Rockets?
| SELECT years_for_rockets FROM table_11734041_3 WHERE no_s_ = "13" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | 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 = "Calculated Bicarbonate, Whole Blood" | mimicsql_data |
CREATE TABLE table_name_49 (
example_meaning_in_english VARCHAR,
standard_thai VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What example in English has a Standard Thai of ?
| SELECT example_meaning_in_english FROM table_name_49 WHERE standard_thai = "ผ่า" | 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTy... | SELECT DisplayName, C.Text AS Comment, C.CreationDate FROM Users AS u INNER JOIN Comments AS C ON u.Id = C.UserId | sede |
CREATE TABLE table_39360 (
"Date" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Attendances have a Result F A of 0 2, and a Date of 31 january 1903?
| SELECT AVG("Attendance") FROM table_39360 WHERE "Result F \u2013 A" = '0 – 2' AND "Date" = '31 january 1903' | wikisql |
CREATE TABLE enzyme (
id VARCHAR,
name VARCHAR
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id VARCHAR,
interaction_type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the id and name of the enzyme with most number of medicines that c... | SELECT T1.id, T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_name_78 (
playoffs VARCHAR,
manager VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Manager of spencer abbott, and a Year of 1919 involves what playoffs?
| SELECT playoffs FROM table_name_78 WHERE manager = "spencer abbott" AND year = 1919 | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT MED_ORG_DEPT_NM, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '0671916' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_NM HAVING AVG(PERSON_AGE) < 30 | css |
CREATE TABLE table_16879 (
"No. in series" text,
"No. in season" text,
"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 "No. in series" FROM table_16879 WHERE "Featured character(s)" = 'Jack & Locke' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "DiphenhydrAMINE HCl" | mimicsql_data |
CREATE TABLE Person (
gender VARCHAR,
age INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average age for each gender?
| SELECT AVG(age), gender FROM Person GROUP BY gender | sql_create_context |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE T... | SELECT Date AS "dates", SUM(pd.Questions) AS "questions_by_day" FROM (SELECT SUM(CASE WHEN p.PostTypeId = 1 THEN 1 ELSE 0 END) AS "questions", DATE(p.CreationDate) AS "date" FROM Posts AS p GROUP BY DATE(p.CreationDate)) AS pd GROUP BY Date ORDER BY Date | sede |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '范雅韶' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' | css |
CREATE TABLE table_204_468 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which driver drove the least ... | SELECT "driver" FROM table_204_468 ORDER BY "laps" LIMIT 1 | squall |
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 gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '5586017' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2007-12-26' AND '2014-05-19' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE f... | css |
CREATE TABLE table_name_93 (
position VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Chris Hanburger's position?
| SELECT position FROM table_name_93 WHERE name = "chris hanburger" | sql_create_context |
CREATE TABLE table_name_74 (
member VARCHAR,
state VARCHAR,
electorate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which member is from the state of SA and the grey electorate?
| SELECT member FROM table_name_74 WHERE state = "sa" AND electorate = "grey" | sql_create_context |
CREATE TABLE table_25146 (
"Season" text,
"Games" real,
"Won" real,
"Lost" real,
"Tied" real,
"Points" real,
"Winning Pct. %" text,
"Goals for" real,
"Goals against" real,
"Standing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
--... | SELECT "Winning Pct. %" FROM table_25146 WHERE "Goals for" = '322' | wikisql |
CREATE TABLE table_65687 (
"Pick" real,
"Player" text,
"Team" text,
"Position" text,
"Hometown/School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the pick # of the player who has a hometown/school of Atlanta, GA?
| SELECT AVG("Pick") FROM table_65687 WHERE "Hometown/School" = 'atlanta, ga' | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "5070" | mimicsql_data |
CREATE TABLE table_67742 (
"Island" text,
"Nickname" text,
"Area" text,
"Population (as of 2010)" real,
"Highest point" text,
"Elevation" text,
"Age ( Ma )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most point with population l... | SELECT "Highest point" FROM table_67742 WHERE "Population (as of 2010)" < '144,444' AND "Age ( Ma )" = '1.0' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ tim... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND... | css |
CREATE TABLE table_name_41 (
particle VARCHAR,
isospin_i VARCHAR,
commonly_decays_to VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Particle has an Isospin I of 1 and Commonly decays to p + + 0 or n 0 + +?
| SELECT particle FROM table_name_41 WHERE isospin_i = "1" AND commonly_decays_to = "p + + π 0 or n 0 + π +" | sql_create_context |
CREATE TABLE table_1277350_7 (
friday_day_six VARCHAR,
thursday_day_five VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is friday day six when thursday day five is pachhambey?
| SELECT friday_day_six FROM table_1277350_7 WHERE thursday_day_five = "پچھمبے pachhambey" | sql_create_context |
CREATE TABLE table_49570 (
"Location" text,
"Year" real,
"Champion" text,
"Runner-up" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the champion with a score of 7 6, 6 0?
| SELECT "Champion" FROM table_49570 WHERE "Score" = '7–6, 6–0' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName te... | SELECT TIME_TO_STR(CreationDate, '%Y') * 100 + TIME_TO_STR(CreationDate, '%m') AS YearMonth, SUM(CASE WHEN ParentId IS NULL THEN 1 ELSE 0 END) AS TotalQuestions, SUM(CASE WHEN NOT ParentId IS NULL THEN 1 ELSE 0 END) AS TotalAnswers FROM Posts GROUP BY TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%m') ORD... | sede |
CREATE TABLE table_23285761_10 (
score VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the game against Houston?
| SELECT score FROM table_23285761_10 WHERE team = "Houston" | sql_create_context |
CREATE TABLE table_203_545 (
id number,
"single/ep" text,
"release date" text,
"label" text,
"format(s)" text,
"uk singles chart position" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many singles were on the uk singles... | SELECT COUNT("single/ep") FROM table_203_545 WHERE NOT "uk singles chart position" IS NULL | squall |
CREATE TABLE table_name_71 (
power__horsepower_ INTEGER,
year_built INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the power of the unit built after 1995?
| SELECT SUM(power__horsepower_) FROM table_name_71 WHERE year_built > 1995 | sql_create_context |
CREATE TABLE table_49429 (
"Date" text,
"Time" text,
"Home" text,
"Geust" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home of the geust fc basel (asl)?
| SELECT "Home" FROM table_49429 WHERE "Geust" = 'fc basel (asl)' | wikisql |
CREATE TABLE table_name_64 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for 2006, when 2013 is 2 4?
| SELECT 2006 FROM table_name_64 WHERE 2013 = "2–4" | sql_create_context |
CREATE TABLE table_name_33 (
date VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the game played at Punt Road Oval?
| SELECT date FROM table_name_33 WHERE venue = "punt road oval" | 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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND j... | css |
CREATE TABLE student_course_registrations (
student_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is id of students who registered some courses but the least number of courses in these students?
| SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY COUNT(*) LIMIT 1 | sql_create_context |
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 COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5403493' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MAX(t_kc21.IN_HOSP_DAYS) < 18) AS T | css |
CREATE TABLE table_name_87 (
black VARCHAR,
opening VARCHAR,
white VARCHAR,
moves VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent of Anand in the match with 20 moves that opened with E15 Queen's Indian Defence?
| SELECT black FROM table_name_87 WHERE white = "anand" AND moves = 20 AND opening = "e15 queen's indian defence" | sql_create_context |
CREATE TABLE table_27593 (
"June 10-11" text,
"March 27-29" text,
"January 15-16" text,
"November 3" text,
"August 21-22" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- june 10-11 when november 3 is 133?
| SELECT "June 10-11" FROM table_27593 WHERE "November 3" = '133' | wikisql |
CREATE TABLE table_name_92 (
country VARCHAR,
to_par VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country is the player ho had a To par of +1 and a score of 69-70-72=211 from?
| SELECT country FROM table_name_92 WHERE to_par = "+1" AND score = 69 - 70 - 72 = 211 | sql_create_context |
CREATE TABLE table_66685 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the game before week 3 with an attendance of 53,658?
| SELECT "Result" FROM table_66685 WHERE "Week" < '3' AND "Attendance" = '53,658' | wikisql |
CREATE TABLE table_name_33 (
away_team VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the away team of the game with tie number 31?
| SELECT away_team FROM table_name_33 WHERE tie_no = "31" | 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 course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN program_course ON program_course.course_id = course_offering.course_id INN... | advising |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH... | css |
CREATE TABLE table_62452 (
"Class" text,
"Number(s)" text,
"Quantity" text,
"Year(s) of Manufacture" text,
"Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number corresponds to the quantity of 24?
| SELECT "Number(s)" FROM table_62452 WHERE "Quantity" = '24' | wikisql |
CREATE TABLE table_35126 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest total medals the team with more than 0 bronze, 6 silver, and a rank highe... | SELECT MIN("Total") FROM table_35126 WHERE "Bronze" > '0' AND "Silver" = '6' AND "Rank" < '3' | wikisql |
CREATE TABLE table_2429942_2 (
top_goalscorer VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the top goalscorer for season 2001-02?
| SELECT top_goalscorer FROM table_2429942_2 WHERE season = "2001-02" | sql_create_context |
CREATE TABLE table_19149550_7 (
london_borough VARCHAR,
black_caribbean_population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where are the london borough with the black caribbean population of 17974?
| SELECT london_borough FROM table_19149550_7 WHERE black_caribbean_population = 17974 | sql_create_context |
CREATE TABLE table_22514845_5 (
s_host VARCHAR,
s_analyst VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the host for john rotz and howard cosell
| SELECT s_host FROM table_22514845_5 WHERE s_analyst = "John Rotz and Howard Cosell" | sql_create_context |
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.icd9_code = "0389" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT MAX(T1.hs), ppos FROM player AS T1 JOIN tryout AS T2 ON T1.pid = T2.pid WHERE T1.hs > 1000 GROUP BY T2.ppos | spider |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password... | SELECT author_id, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_51881 (
"D 41" text,
"D 42" text,
"D 43" text,
"D 44" text,
"D 45" text,
"D 46" text,
"R 54" text,
"R 53" text,
"R 52" text,
"R 51" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the D 42 which has a D 44 ... | SELECT "D 42" FROM table_51881 WHERE "D 44" = 'd 44' | wikisql |
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE stu... | SELECT title, AVG(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title | nvbench |
CREATE TABLE table_name_4 (
rank VARCHAR,
notes VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's Brazil's rank when it has notes of R?
| SELECT COUNT(rank) FROM table_name_4 WHERE notes = "r" AND country = "brazil" | sql_create_context |
CREATE TABLE table_3071 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Wildcats points" real,
"Opponents" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Against what opponent did the Wildcats have a record of 5-4... | SELECT "Opponent" FROM table_3071 WHERE "Record" = '5-4' | 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 u.Id AS "user_link", (SUM(COALESCE(DATALENGTH(p.Body), 0)) + SUM(COALESCE(DATALENGTH(p.Title), 0))) AS keystrokes, u.Reputation, (SUM(COALESCE(DATALENGTH(p.Body), 0)) + SUM(COALESCE(DATALENGTH(p.Title), 0))) / u.Reputation AS rate FROM Users AS u, Posts AS p WHERE p.OwnerUserId = u.Id AND u.Reputation >= 1000 GR... | sede |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId numb... | SELECT Id AS "user_link", Reputation, CreationDate, DisplayName, LastAccessDate FROM Users WHERE (Reputation > '##rep##') AND (DisplayName LIKE '%user%') ORDER BY Reputation DESC | sede |
CREATE TABLE table_17309500_1 (
assists VARCHAR,
blocks VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of assists for 77 blocks
| SELECT COUNT(assists) FROM table_17309500_1 WHERE blocks = "77" | sql_create_context |
CREATE TABLE table_203_615 (
id number,
"district" text,
"incumbent" text,
"party" text,
"first\nelected" number,
"result" text,
"candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many candidates were part of the republican part... | SELECT COUNT(*) FROM table_203_615 WHERE "party" = 'republican' | squall |
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Assessment_Notes (
notes_id INTEGER,
student_id INTEGER,
teacher_id INTEGER,
date_of_notes DATETIME,
text_of_notes VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE... | SELECT date_address_from, COUNT(date_address_from) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.cours... | advising |
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_Regular_Season, Team_ID FROM basketball_match | nvbench |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewT... | SELECT DISTINCT u.Id AS "user_link", CONCAT('https://stackoverflow.com/users/', u.Id) AS "profile_link", u.DisplayName, u.Location, u.WebsiteUrl, u.AboutMe, u.Views, u.Reputation, u.UpVotes, u.DownVotes, u.EmailHash FROM Users AS u WHERE UPPER(u.AboutMe) LIKE UPPER('%##SkillName##%') AND UPPER(Location) LIKE UPPER('%##... | sede |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
Revision... | WITH users_cte AS (SELECT u.Id AS UserId, SUM(CASE WHEN p.PostTypeId = 1 THEN p.Score ELSE 0 END) AS QScore, SUM(CASE WHEN p.PostTypeId = 1 THEN 1 ELSE 0 END) AS QCount, SUM(CASE WHEN p.PostTypeId = 2 THEN p.Score ELSE 0 END) AS AScore, SUM(CASE WHEN p.PostTypeId = 2 THEN 1 ELSE 0 END) AS ACount FROM Users AS u INNER J... | sede |
CREATE TABLE table_name_63 (
winner VARCHAR,
route VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner of the mechelen > mechelen route?
| SELECT winner FROM table_name_63 WHERE route = "mechelen > mechelen" | sql_create_context |
CREATE TABLE table_22994 (
"Pos" real,
"Member Association" text,
"Points (total 500)" real,
"Clubs" real,
"Group stage" real,
"Play-off" real,
"AFC Cup" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which club in group stage 4 had member a... | SELECT "Clubs" FROM table_22994 WHERE "Group stage" = '4' AND "Member Association" = 'Iran' | wikisql |
CREATE TABLE table_name_33 (
finish VARCHAR,
total INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what place(s) did the player(s) with a total less than 282 finish?
| SELECT finish FROM table_name_33 WHERE total < 282 | sql_create_context |
CREATE TABLE table_52793 (
"Analog Channel" text,
"Digital Channel" text,
"Call sign" text,
"Name" text,
"Network" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which digital channel is named Storm Tracker?
| SELECT "Digital Channel" FROM table_52793 WHERE "Name" = 'storm tracker' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'drug abuse nec-in remiss') AND STRFTIME('%y', diagnoses_icd.charttime) <= ... | mimic_iii |
CREATE TABLE table_4522 (
"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 lowest crowd when the away side score... | SELECT MIN("Crowd") FROM table_4522 WHERE "Away team score" = '11.16 (82)' | wikisql |
CREATE TABLE table_name_74 (
storms__days_year_ VARCHAR,
fog__days_year_ VARCHAR,
sunshine__hrs_year_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the number of storms where fog is lower than 74, and sunshine is 2 668?
| SELECT COUNT(storms__days_year_) FROM table_name_74 WHERE fog__days_year_ < 74 AND sunshine__hrs_year_ = "2 668" | sql_create_context |
CREATE TABLE table_name_99 (
position VARCHAR,
height VARCHAR,
current_club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the position of the player with a Height of 2.06 and club of Triumph Lyubertsy?
| SELECT position FROM table_name_99 WHERE height = 2.06 AND current_club = "triumph lyubertsy" | sql_create_context |
CREATE TABLE table_3654 (
"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.
-- What is the nhl team for the position centre and nationality ... | SELECT "NHL team" FROM table_3654 WHERE "Position" = 'Centre' AND "Nationality" = 'United States' | wikisql |
CREATE TABLE table_20124413_1 (
original_airdate VARCHAR,
prod_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 1.17 is the production code how many air dates are there?
| SELECT COUNT(original_airdate) FROM table_20124413_1 WHERE prod_code = "1.17" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.