instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_10887 (
"Season" text,
"Games" real,
"Lost" real,
"Tied" real,
"Points" real,
"Goals for" real,
"Goals against" real,
"Standing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games had a tied less 15 with goa... | SELECT COUNT("Games") FROM table_10887 WHERE "Tied" < '15' AND "Goals against" < '186' | wikisql |
CREATE TABLE table_17831 (
"Colt model no." text,
"Diemaco model" text,
"Stock" text,
"Fire control" text,
"Rear sight" text,
"Forward assist" text,
"Barrel length" text,
"Barrel profile" text,
"Barrel twist" text,
"Hand guards" text,
"Bayonet Lug" text,
"Muzzle device" t... | SELECT "Hand guards" FROM table_17831 WHERE "Rear sight" = 'A1' AND "Stock" = 'A2' | wikisql |
CREATE TABLE table_name_99 (
field_goals VARCHAR,
extra_points VARCHAR,
touchdowns VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of field goals for a player that had less than 3 touchdowns, had 4 points, and ... | SELECT COUNT(field_goals) FROM table_name_99 WHERE touchdowns < 3 AND points = 4 AND extra_points < 4 | sql_create_context |
CREATE TABLE table_name_17 (
band VARCHAR,
album_or_song VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which band plays Self Versus Self - Immersion?
| SELECT band FROM table_name_17 WHERE album_or_song = "self versus self - immersion" | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE T... | SELECT OwnerUserId, Score FROM Posts INNER JOIN (SELECT OwnerUserId AS id, MAX(CreationDate) AS maxDate FROM Posts GROUP BY OwnerUserId) AS p ON Posts.OwnerUserId = p.Id AND Posts.CreationDate = p.maxDate LIMIT 20 | sede |
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE... | SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination DESC | nvbench |
CREATE TABLE table_32583 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position does the player from Texas State who was drafted before round 11 with an overall... | SELECT "Position" FROM table_32583 WHERE "Overall" < '306' AND "Round" < '11' AND "School/Club Team" = 'texas state' | wikisql |
CREATE TABLE tweets (
text VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return the text of tweets about the topic 'intern'.
| SELECT text FROM tweets WHERE text LIKE '%intern%' | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
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,
JCZBJGDX text... | SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZ... | css |
CREATE TABLE table_203_457 (
id number,
"tramway" text,
"country" text,
"city" text,
"height of pylons" text,
"span width,\nleaning straight line" text,
"span width,\nhorizontal measurement" text,
"height of cable over ground" text,
"year of inauguration" number,
"notes" text
)
... | SELECT "tramway" FROM table_203_457 WHERE "year of inauguration" = (SELECT "year of inauguration" FROM table_203_457 WHERE "tramway" = '3s aerial tramway') - 1 | squall |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT (SELECT PER_ACC_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '44533265221') / (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '44533265221') | css |
CREATE TABLE table_30393 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When sylvania, oh is the locatio... | SELECT "Team Nickname" FROM table_30393 WHERE "Location" = 'Sylvania, OH' | wikisql |
CREATE TABLE table_50020 (
"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 to par of the player from the United States with a place of t1 and a 76-68=144 score?
| SELECT "To par" FROM table_50020 WHERE "Country" = 'united states' AND "Place" = 't1' AND "Score" = '76-68=144' | wikisql |
CREATE TABLE table_24056 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the broadcast date for 7.4 viewers
| SELECT "Broadcast date" FROM table_24056 WHERE "Viewers (in millions)" = '7.4' | wikisql |
CREATE TABLE table_70175 (
"Pick #" text,
"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.
-- Which team has a right wing position listed?
| SELECT "College/junior/club team" FROM table_70175 WHERE "Position" = 'right wing' | wikisql |
CREATE TABLE table_75509 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the nominee of best musical
| SELECT "Nominee" FROM table_75509 WHERE "Category" = 'best musical' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96833) AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') | mimic_iii |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TA... | SELECT e.PostId AS "post_link" FROM SuggestedEdits AS e INNER JOIN PostHistory AS th ON e.PostId = th.PostId AND e.ApprovalDate = th.CreationDate LEFT OUTER JOIN PostHistory AS h ON e.PostId = h.PostId AND e.ApprovalDate = h.CreationDate AND e.OwnerUserId = h.UserId AND h.PostHistoryTypeId IN (4, 5) WHERE th.PostHistor... | sede |
CREATE TABLE table_48859 (
"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 To Par is +1, and when Score is 72-70-72=214?
| SELECT "Player" FROM table_48859 WHERE "To par" = '+1' AND "Score" = '72-70-72=214' | wikisql |
CREATE TABLE table_42054 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average against that has a drawn le... | SELECT AVG("Against") FROM table_42054 WHERE "Drawn" < '7' AND "Points" > '22' AND "Played" = '19' | wikisql |
CREATE TABLE diagnoses (
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
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.dob_year < "2043" | mimicsql_data |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_i... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... | mimic_iii |
CREATE TABLE table_12983929_1 (
total_power VARCHAR,
construction_start VARCHAR,
commercial_operation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different values of total power are there for the unit whose construction started on 01.03.1977 ... | SELECT COUNT(total_power) FROM table_12983929_1 WHERE construction_start = "01.03.1977" AND commercial_operation = "01.02.1984" | sql_create_context |
CREATE TABLE table_22559 (
"Date" real,
"Single" text,
"Backed with" text,
"Record label" text,
"Format" text,
"Other details" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the 'other details' (number released) for 'is my love will fo... | SELECT "Other details" FROM table_22559 WHERE "Single" = 'My Love Will Follow Me' | wikisql |
CREATE TABLE table_24432 (
"Year" text,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Team" FROM table_24432 WHERE "Date" = 'June 16' AND "Driver" = 'Jeff Gordon' | wikisql |
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
home town text
)
CREATE TABLE perpetrator (
perpetrator_id number,
people_id number,
date text,
year number,
location text,
country text,
killed number,
injured number
)
-- Using valid... | SELECT country, COUNT(*) FROM perpetrator GROUP BY country HAVING COUNT(*) >= 2 | spider |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
a... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7073) AND STRFTIME('%y', procedures_icd.charttime) <= '2104' | mimic_iii |
CREATE TABLE table_71174 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the surface for the May 10, 2009 tournament?
| SELECT "Surface" FROM table_71174 WHERE "Date" = 'may 10, 2009' | wikisql |
CREATE TABLE table_34806 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which tournament was vijay singh a runner-up?
| SELECT "Tournament" FROM table_34806 WHERE "Runner-up" = 'vijay singh' | wikisql |
CREATE TABLE table_33580 (
"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 smallest crowd when richmond is away... | SELECT MIN("Crowd") FROM table_33580 WHERE "Away team" = 'richmond' | 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.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '12012612' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_66 (
poles VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of poles and 63 points?
| SELECT COUNT(poles) FROM table_name_66 WHERE points = "63" | sql_create_context |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT Sex, SUM(Height) FROM people GROUP BY Sex | nvbench |
CREATE TABLE table_45268 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was t... | SELECT "Replaced by" FROM table_45268 WHERE "Position in table" = '11th' AND "Manner of departure" = 'resigned' | wikisql |
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 gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9550631' AND gwyjzb.IN_HOSP_DATE BETWEEN '2007-02-26' AND '2020-08-03' AND gwyjzb.INSURED_STS = '未就业' AND gwyjzb.MED_AMOUT >= 5252.43 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9550631' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2007-02-26' AND '... | css |
CREATE TABLE table_203_751 (
id number,
"year" number,
"title" text,
"peak chart positions\nus\nair" number,
"peak chart positions\nus\nmain" number,
"peak chart positions\nus\nmod" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT COUNT("peak chart positions\nus\nmain") FROM table_203_751 | squall |
CREATE TABLE table_70792 (
"Model" text,
"Specification" text,
"Build date" text,
"Total produced" real,
"Wheel arrangement" text,
"Prime mover" text,
"Power output" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which wheel arrangement had ... | SELECT "Wheel arrangement" FROM table_70792 WHERE "Specification" = 'dl-700' | wikisql |
CREATE TABLE table_name_19 (
lost VARCHAR,
start VARCHAR,
pens VARCHAR,
tries VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total losses for the player with fewer than 51 pens, 3 tries and 45 starts?
| SELECT COUNT(lost) FROM table_name_19 WHERE pens < 51 AND tries = 3 AND start = 45 | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "34590" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_name_7 (
code VARCHAR,
capacity VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the code of 1.5 dci 110, which has a capacity of 1,461cc?
| SELECT code FROM table_name_7 WHERE capacity = "1,461cc" AND name = "1.5 dci 110" | sql_create_context |
CREATE TABLE exhibition_record (
exhibition_id number,
date text,
attendance number
)
CREATE TABLE artist (
artist_id number,
name text,
country text,
year_join number,
age number
)
CREATE TABLE exhibition (
exhibition_id number,
year number,
theme text,
artist_id numbe... | SELECT COUNT(*) FROM artist WHERE age > 46 AND year_join > 1990 | spider |
CREATE TABLE table_22453 (
"Candidate" text,
"Background" text,
"Original Team" text,
"Age" real,
"Hometown" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When austin, texas is the hometown what is the lowest age?
| SELECT MIN("Age") FROM table_22453 WHERE "Hometown" = 'Austin, Texas' | wikisql |
CREATE TABLE table_name_58 (
d_43_√ VARCHAR,
d_42_√ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the value of D 43 when the value of D 42 is d 42 ?
| SELECT d_43_√ FROM table_name_58 WHERE d_42_√ = "d 42 √" | sql_create_context |
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.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 WHERE course_offering.friday = 'N' AND course.department = 'DANCE' AND semester.semester = 'WN' AND ... | advising |
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "DMI neuro nt st uncntrld" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE management (
department_ID int,
head_ID int,
tempor... | SELECT born_state, AVG(age) FROM head GROUP BY born_state ORDER BY born_state | nvbench |
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE faculty... | SELECT rank, fname, lname FROM faculty | spider |
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
... | SELECT building, COUNT(building) FROM department WHERE budget > (SELECT AVG(budget) FROM department) GROUP BY building ORDER BY COUNT(building) | nvbench |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeI... | SELECT * FROM Posts WHERE AnswerCount = 0 ORDER BY CreationDate DESC LIMIT 10 | sede |
CREATE TABLE table_77922 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1st leg where Team 1 is C.D. Plaza Amador?
| SELECT "1st leg" FROM table_77922 WHERE "Team 1" = 'c.d. plaza amador' | 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 IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '0987112' GROUP BY IN_DIAG_DIS_CD | css |
CREATE TABLE table_9208 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Opponent, when Week is '5'?
| SELECT "Opponent" FROM table_9208 WHERE "Week" = '5' | wikisql |
CREATE TABLE table_1944 (
"Property" text,
"K-band" text,
"Ka-band" text,
"Q-band" text,
"V-band" text,
"W-band" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 2 is the k-band what is the v-band?
| SELECT "V-band" FROM table_1944 WHERE "K-band" = '2' | wikisql |
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 record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_400 | nvbench |
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
fam... | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion) DESC | nvbench |
CREATE TABLE table_name_72 (
is_3_m1945 VARCHAR,
kv_1s_m1942 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the IS-3 when the KV-1S is 45?
| SELECT is_3_m1945 FROM table_name_72 WHERE kv_1s_m1942 = "45" | sql_create_context |
CREATE TABLE table_48760 (
"Game" real,
"Date" text,
"Opponent" 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.
-- Wh... | SELECT "High points" FROM table_48760 WHERE "Location/Attendance" = 'conseco fieldhouse 7,134' | wikisql |
CREATE TABLE table_name_52 (
played INTEGER,
points VARCHAR,
bp VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Played that has a Points of 38, and a B.P. larger than 5 has what sum?
| SELECT SUM(played) FROM table_name_52 WHERE points = 38 AND bp > 5 | sql_create_context |
CREATE TABLE table_24919 (
"School" text,
"Location" text,
"Team Name" text,
"Colors" text,
"Varsity Teams" real,
"NJCAA Championships" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the varsity team is 6, what is the location?
| SELECT "Location" FROM table_24919 WHERE "Varsity Teams" = '6' | 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 WHERE demographic.days_stay > "4" | mimicsql_data |
CREATE TABLE table_52870 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps for grid of 9?
| SELECT "Laps" FROM table_52870 WHERE "Grid" = '9' | wikisql |
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_600, ID FROM swimmer | nvbench |
CREATE TABLE table_41185 (
"Name" text,
"Novelty" text,
"Status" text,
"Authors" text,
"Unit" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Status with a novelty of gen et sp, and the name is haplocanthosaurus?
| SELECT "Status" FROM table_41185 WHERE "Novelty" = 'gen et sp' AND "Name" = 'haplocanthosaurus' | wikisql |
CREATE TABLE table_23916462_3 (
week INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least value for week?
| SELECT MIN(week) FROM table_23916462_3 | sql_create_context |
CREATE TABLE table_name_37 (
date VARCHAR,
final_score VARCHAR,
stadium VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the game at Gillette Stadium that ended in a final score of 30-17?
| SELECT date FROM table_name_37 WHERE final_score = "30-17" AND stadium = "gillette stadium" | sql_create_context |
CREATE TABLE table_7424 (
"Player" text,
"FG Pct" real,
"3FGM" real,
"3FGA" real,
"3FG Pct" real,
"FT Pct" real,
"Off Reb" real,
"Def Reb" real,
"Total Reb" real,
"Asst" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ... | SELECT SUM("FG Pct") FROM table_7424 WHERE "Asst" > '3' AND "Def Reb" = '30' AND "3FG Pct" > '36.1' | wikisql |
CREATE TABLE table_name_58 (
d_45 VARCHAR,
d_42 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the D 45 and D 42 of r 22
| SELECT d_45 FROM table_name_58 WHERE d_42 = "r 22" | sql_create_context |
CREATE TABLE table_name_24 (
attendance INTEGER,
season VARCHAR,
games VARCHAR,
w_l_t VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Attendance has Games smaller than 6, and a W-L-T of 3-2-0, and a Season smaller than 1948?
| SELECT SUM(attendance) FROM table_name_24 WHERE games < 6 AND w_l_t = "3-2-0" AND season < 1948 | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationD... | SELECT Posts.Id, Posts.Title, Posts.Tags FROM Posts WHERE Posts.Tags LIKE '%<unit>%' AND NOT Posts.Tags LIKE '%<testing>%' AND NOT Posts.Tags LIKE '%<unit-testing>%' | sede |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Pressure ulcer, hip" AND prescriptions.route = "IV BOLUS" | mimicsql_data |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'AS' | atis |
CREATE TABLE table_name_80 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result from 2003 from the US Open?
| SELECT 2003 FROM table_name_80 WHERE tournament = "us open" | sql_create_context |
CREATE TABLE table_34230 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"Long" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many yards did Davin Meggett have with more than 9 Rec.?
| SELECT SUM("Yards") FROM table_34230 WHERE "Player" = 'davin meggett' AND "Rec." > '9' | wikisql |
CREATE TABLE table_name_10 (
record VARCHAR,
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Record has an Opponent of twins, and a Date of july 25?
| SELECT record FROM table_name_10 WHERE opponent = "twins" AND date = "july 25" | sql_create_context |
CREATE TABLE table_name_52 (
wins INTEGER,
top_25 VARCHAR,
cuts_made VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest number of wins for a top-25 value greater than 5 and more than 38 cuts?
| SELECT MIN(wins) FROM table_name_52 WHERE top_25 > 5 AND cuts_made > 38 | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerU... | SELECT Title, Tags, ViewCount FROM Posts WHERE ViewCount > 1000 ORDER BY ViewCount DESC | sede |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605' AND patient.hospitaldischargetime IS NULL)) AND intakeoutput.c... | eicu |
CREATE TABLE table_14507 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Gold of 0, and a Silver smaller than 3, and a Rank larger than 9, and a Total of 1 has how many numbers of bron... | SELECT COUNT("Bronze") FROM table_14507 WHERE "Gold" = '0' AND "Silver" < '3' AND "Rank" > '9' AND "Total" = '1' | wikisql |
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age int
)
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year int
)
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of t... | SELECT Open_Date, COUNT(Open_Date) FROM church ORDER BY Open_Date DESC LIMIT 3 | nvbench |
CREATE TABLE table_27816698_2 (
founded INTEGER,
nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the Titans founded?
| SELECT MAX(founded) FROM table_27816698_2 WHERE nickname = "Titans" | 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 prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'open wound of scalp' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'open wound of scalp' | mimic_iii |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE food_service (
meal_... | 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIM... | atis |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 75658) AND microbiologyevents.spec_type_desc = 'sputum' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 yea... | mimic_iii |
CREATE TABLE table_203_234 (
id number,
"description" text,
"total" number,
"poland" number,
"baltic states(resettled in poland during war)" number,
"resettled in poland during war(from ussr and romania)" number,
"sudetendeutsch" number,
"se europe\n(hungary, romania, yugoslavia & slovak... | SELECT "description" FROM table_203_234 ORDER BY "total" DESC LIMIT 1 | squall |
CREATE TABLE table_75384 (
"Polling Firm" text,
"Date" text,
"PSD - PC" text,
"UDMR" text,
"Elena B\u0103sescu" text,
"Others" text,
"Undecided" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the UDMR for 18-22/04/2009?
| SELECT "UDMR" FROM table_75384 WHERE "Date" = '18-22/04/2009' | wikisql |
CREATE TABLE table_203_421 (
id number,
"name" text,
"from" text,
"until" text,
"relationship with predecessor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the head of the medici for the most years ?
| SELECT "name" FROM table_203_421 ORDER BY "until" - "from" DESC LIMIT 1 | squall |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_77724 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Record when Buffalo is at Home?
| SELECT "Record" FROM table_77724 WHERE "Home" = 'buffalo' | wikisql |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9880958' AND gwyjzb.IN_DIAG_DIS_NM = '矽肺贰期' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9880958' AND fgwyjzb.IN_DIAG_D... | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2138" AND procedures.short_title = "Endosc destr stomach les" | mimicsql_data |
CREATE TABLE table_76119 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Home team has an Away team of everton?
| SELECT "Home team" FROM table_76119 WHERE "Away team" = 'everton' | wikisql |
CREATE TABLE city (
city_id number,
city text,
country_id number,
last_update time
)
CREATE TABLE film_actor (
actor_id number,
film_id number,
last_update time
)
CREATE TABLE inventory (
inventory_id number,
film_id number,
store_id number,
last_update time
)
CREATE TABLE... | SELECT T2.first_name, T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id HAVING COUNT(*) > 30 | spider |
CREATE TABLE table_68681 (
"Title" text,
"Year" text,
"Developer" text,
"Publisher" text,
"Platform" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who published Star Citizen in 2014?
| SELECT "Publisher" FROM table_68681 WHERE "Year" = '2014' AND "Title" = 'star citizen' | wikisql |
CREATE TABLE table_name_43 (
athlete VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which athlete, has an 18.55 result
| SELECT athlete FROM table_name_43 WHERE result = 18.55 | sql_create_context |
CREATE TABLE table_27615520_1 (
form_factor VARCHAR,
product_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the range distroration for the ramsan-630
| SELECT form_factor FROM table_27615520_1 WHERE product_name = "RamSan-630" | sql_create_context |
CREATE TABLE table_51934 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the driver with the grid of 13?
| SELECT "Driver" FROM table_51934 WHERE "Grid" = '13' | wikisql |
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team i... | SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27177) AND prescriptions.drug = 'potassium chloride' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-162 month') ORDER BY prescriptions.startdat... | mimic_iii |
CREATE TABLE table_70135 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Trofeo Fast Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the general classific... | SELECT "General classification" FROM table_70135 WHERE "Points classification" = 'tony rominger' AND "Stage" = '18' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.