instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_25076 (
"Year" real,
"Network" text,
"Race caller" text,
"s Host" text,
"s Analyst" text,
"Reporters" text,
"Trophy presentation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which network has s analyst of eddie arcaro?
| SELECT "Network" FROM table_25076 WHERE "s Analyst" = 'Eddie Arcaro' | wikisql |
CREATE TABLE table_name_72 (
campeonato_paulista VARCHAR,
copa_sudamericana VARCHAR,
campeonato_brasileiro VARCHAR,
others VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Campeonato Paulistas had a campeonato brasileiro of more than 2, an oth... | SELECT COUNT(campeonato_paulista) FROM table_name_72 WHERE campeonato_brasileiro > 2 AND others > 0 AND copa_sudamericana > 5 | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "E9429" AND prescriptions.route = "NU" | mimicsql_data |
CREATE TABLE table_37118 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the loss of who has a Save of Miguel Saladin and played against Chinatrust Whales?
| SELECT "Loss" FROM table_37118 WHERE "Opponent" = 'chinatrust whales' AND "Save" = 'miguel saladin' | wikisql |
CREATE TABLE table_name_81 (
last_update VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- for the name of jamar jackson what is the last update?
| SELECT last_update FROM table_name_81 WHERE name = "jamar jackson" | sql_create_context |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_34 (
best INTEGER,
qual_2 VARCHAR,
team VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Graham rahal for n/h/l racing has a qual 2 greater than 59.384 and how much lowest best?
| SELECT MIN(best) FROM table_name_34 WHERE team = "n/h/l racing" AND name = "graham rahal" AND qual_2 > 59.384 | sql_create_context |
CREATE TABLE table_name_66 (
constructor VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the contstructor of the car having a grid of 20?
| SELECT constructor FROM table_name_66 WHERE grid = "20" | sql_create_context |
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE team (
Team_id int,
... | SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Pick_Number DESC | nvbench |
CREATE TABLE table_13929 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What season had a 14th position?
| SELECT "Season" FROM table_13929 WHERE "Position" = '14th' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id number,... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22245) AND microbiologyevents.spec_type_desc = 'stool' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(... | mimic_iii |
CREATE TABLE table_54082 (
"D 39 \u221a" text,
"D 40 \u221a" text,
"D 41 \u221a" text,
"D 42 \u221a" text,
"D 43 \u221a" text,
"D 44 \u221a" text,
"D 45 \u221a" text,
"D 46 \u221a" text,
"D 47 \u221a" text,
"D 48 \u221a" text
)
-- Using valid SQLite, answer the following questi... | SELECT "D 42 \u221a" FROM table_54082 WHERE "D 44 \u221a" = 'majority→' | wikisql |
CREATE TABLE table_44754 (
"Lane" real,
"Name" text,
"Country" text,
"Mark" text,
"React" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Mark, when Lane is greater than 2, and when Country is Bahamas?
| SELECT "Mark" FROM table_44754 WHERE "Lane" > '2' AND "Country" = 'bahamas' | wikisql |
CREATE TABLE table_name_3 (
sport VARCHAR,
founded VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What sport was played by the team founded in 2010?
| SELECT sport FROM table_name_3 WHERE founded = 2010 | 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 gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '朱修德' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 2100.78) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '朱修德' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FR... | css |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT COUNT(mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX ... | css |
CREATE TABLE table_name_71 (
race_1 VARCHAR,
team VARCHAR,
race_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Race 1, when Team is 'Dick Johnson Racing', and when Race 3 is 'DNF'?
| SELECT race_1 FROM table_name_71 WHERE team = "dick johnson racing" AND race_3 = "dnf" | sql_create_context |
CREATE TABLE table_3155 (
"Tie no" real,
"Home team" text,
"Score 1" text,
"Away team" text,
"Attendance" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the away team is Millwall, what is the total possible amount of tie number... | SELECT COUNT("Tie no") FROM table_3155 WHERE "Away team" = 'Millwall' | wikisql |
CREATE TABLE table_57607 (
"Country" text,
"Abbreviation" text,
"Assets US$Billion" text,
"Inception" text,
"Origin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the origin for the country abbreviated atf?
| SELECT "Origin" FROM table_57607 WHERE "Abbreviation" = 'atf' | wikisql |
CREATE TABLE table_1984697_53 (
city___town VARCHAR,
principal VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where's the school that Mark Fletcher is the principal of?
| SELECT city___town FROM table_1984697_53 WHERE principal = "Mark Fletcher" | sql_create_context |
CREATE TABLE table_name_34 (
rank VARCHAR,
wins VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank associated with the team that has more than 2 wins and has greater than 204 points?
| SELECT rank FROM table_name_34 WHERE wins > 2 AND points > 204 | sql_create_context |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb 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 WHERE person_info.XM = '奚... | css |
CREATE TABLE table_37935 (
"Programme" text,
"Date(s) of original removal" text,
"Original channel" text,
"Date(s) of return" text,
"New channel(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Going for Gold return in BBC One?
| SELECT "Date(s) of return" FROM table_37935 WHERE "Original channel" = 'bbc one' AND "Programme" = 'going for gold' | wikisql |
CREATE TABLE table_name_46 (
wins VARCHAR,
class VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Wins have a Class of 500cc, and a Year smaller than 1975?
| SELECT wins FROM table_name_46 WHERE class = "500cc" AND year < 1975 | sql_create_context |
CREATE TABLE table_name_88 (
position VARCHAR,
years_for_rockets VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the position of the player who played for the Rockets during 1981?
| SELECT position FROM table_name_88 WHERE years_for_rockets = "1981" | sql_create_context |
CREATE TABLE table_26824484_1 (
original_air_date VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the original air date of the episode that was directed by Jessica Landaw?
| SELECT original_air_date FROM table_26824484_1 WHERE directed_by = "Jessica Landaw" | sql_create_context |
CREATE TABLE table_203_409 (
id number,
"rank" number,
"representative" text,
"party" text,
"district" text,
"seniority date" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the difference in rank between nancy pelosi an... | SELECT ABS((SELECT "rank" FROM table_203_409 WHERE "representative" = 'nancy pelosi') - (SELECT "rank" FROM table_203_409 WHERE "representative" = 'john boehner')) | squall |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE cost (
costid num... | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-31704')) AND STRFTIME('%y', lab.labresulttime) <= '2104' | eicu |
CREATE TABLE table_24302 (
"Census division" text,
"Area (km\u00b2)" text,
"Pop. (2011)" real,
"Pop. (2006)" real,
"Pop. (2001)" real,
"Pop. (1996)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people lived in the census division with... | SELECT "Pop. (1996)" FROM table_24302 WHERE "Area (km\u00b2)" = '15767.99' | wikisql |
CREATE TABLE table_63634 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location/ attendance for a 35-28 record?
| SELECT "Location/Attendance" FROM table_63634 WHERE "Record" = '35-28' | wikisql |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "85" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_name_60 (
year VARCHAR,
issue_price VARCHAR,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was S.A. Allward's theme that had an issue price of $16.95 released?
| SELECT year FROM table_name_60 WHERE issue_price = "$16.95" AND artist = "s.a. allward" | sql_create_context |
CREATE TABLE stock (
shop_id number,
device_id number,
quantity number
)
CREATE TABLE shop (
shop_id number,
shop_name text,
location text,
open_date text,
open_year number
)
CREATE TABLE device (
device_id number,
device text,
carrier text,
package_version text,
ap... | SELECT carrier FROM device WHERE NOT device_id IN (SELECT device_id FROM stock) | spider |
CREATE TABLE table_25479 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what i... | SELECT "Date" FROM table_25479 WHERE "Game" = '29' | wikisql |
CREATE TABLE table_7493 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance at the D... | SELECT "Location Attendance" FROM table_7493 WHERE "Team" = 'denver' | wikisql |
CREATE TABLE table_69337 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position had fewer than 373 laps and a class position of 1st?
| SELECT "Pos." FROM table_69337 WHERE "Laps" < '373' AND "Class Pos." = '1st' | wikisql |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comme... | SELECT Id, REPLACE(REPLACE(REPLACE(Title, CHAR(10) + CHAR(13), '<br />'), CHAR(10), '<br />'), CHAR(13), '<br />') AS "title", Tags, ViewCount, FavoriteCount, CreationDate, Score, REPLACE(REPLACE(REPLACE(Body, CHAR(10) + CHAR(13), '<br />'), CHAR(10), '<br />'), CHAR(13), '<br />') AS "body" FROM Posts WHERE PostTypeId... | sede |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT name, number FROM course WHERE credits = 5 AND department = 'EECS' | advising |
CREATE TABLE table_1103 (
"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 player was drafted by the Chicago Black Hawks?
| SELECT "Player" FROM table_1103 WHERE "NHL team" = 'Chicago Black Hawks' | wikisql |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT COUNT(instructor.name), instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'CSP' AND course.number = 100 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = cou... | advising |
CREATE TABLE table_name_32 (
pos INTEGER,
team VARCHAR,
car__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Pos has a Team of roush fenway racing, and a Car # of 99?
| SELECT SUM(pos) FROM table_name_32 WHERE team = "roush fenway racing" AND car__number = 99 | sql_create_context |
CREATE TABLE table_name_87 (
total INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of 2013 with 6th?
| SELECT MAX(total) FROM table_name_87 WHERE 2013 = "6th" | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationD... | SELECT Questions.Id AS "post_link", Questions.Title, Questions.ViewCount, Answers.Body, Tags.TagName AS TagName FROM Posts AS Answers INNER JOIN Posts AS Questions ON Questions.Id = Answers.ParentId INNER JOIN Users AS Users ON Answers.OwnerUserId = Users.Id INNER JOIN PostTags ON PostTags.PostId = Answers.ParentId INN... | sede |
CREATE TABLE table_name_86 (
bronze VARCHAR,
rank VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum number of bronzes when the rank is less than 2 and the gold is less than 1?
| SELECT COUNT(bronze) FROM table_name_86 WHERE rank < 2 AND gold < 1 | sql_create_context |
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_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_... | 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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Dermatitis NOS" | mimicsql_data |
CREATE TABLE table_name_38 (
laps VARCHAR,
grid INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the laps when the grid is less than 2?
| SELECT laps FROM table_name_38 WHERE grid < 2 | sql_create_context |
CREATE TABLE table_25034983_2 (
start VARCHAR,
nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which year did the voice of muscatine show start?
| SELECT start FROM table_25034983_2 WHERE nickname = "Voice of Muscatine" | sql_create_context |
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
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,
... | SELECT T2.Party, AVG(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party DESC | nvbench |
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE club (
Club_ID int,
name te... | SELECT Position, COUNT(*) FROM player WHERE Points < 30 GROUP BY Position ORDER BY Position DESC | nvbench |
CREATE TABLE table_203_510 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n(/mi2)" number,
"population\ndensity\n(/km2)" number,
"land area\n(mi2)" number,
"land area\n(km2)" number,
"water area\n(mi2)" number,
... | SELECT "township" FROM table_203_510 WHERE "land area\n(mi2)" > (SELECT "land area\n(mi2)" FROM table_203_510 WHERE "township" = 'smyrna') | squall |
CREATE TABLE table_19240 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the away team score for... | SELECT "Away team score" FROM table_19240 WHERE "Away team" = 'Richmond' | wikisql |
CREATE TABLE table_name_4 (
capacity VARCHAR,
volts VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the capacity of 3500v volts?
| SELECT capacity FROM table_name_4 WHERE volts = "3500v" | sql_create_context |
CREATE TABLE table_73847 (
"Name" text,
"Nearest city" text,
"Skiable area (acres)" real,
"Top elevation (feet)" real,
"Base elevation (feet)" real,
"Vertical (feet)" real,
"Runs" text,
"Lifts" real,
"Snowfall (in/year)" real
)
-- Using valid SQLite, answer the following questions ... | SELECT MAX("Base elevation (feet)") FROM table_73847 WHERE "Lifts" = '11' | wikisql |
CREATE TABLE table_52768 (
"Name" text,
"Pennant" text,
"Builder" text,
"Laid Down" text,
"Launched" text,
"Commissioned" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name when the laid down is 28 february 1943?
| SELECT "Name" FROM table_52768 WHERE "Laid Down" = '28 february 1943' | wikisql |
CREATE TABLE table_42103 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What i... | SELECT "Team" FROM table_42103 WHERE "High assists" = 'alvin williams (6)' | wikisql |
CREATE TABLE table_name_58 (
bronze INTEGER,
rank VARCHAR,
total VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of bronze medals associated with 0 silver, 1 total, and ranks over 16?
| SELECT AVG(bronze) FROM table_name_58 WHERE total = 1 AND silver = 0 AND rank > 16 | sql_create_context |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE... | SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 ORDER BY AVG(ID) | nvbench |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT COUNT(*) FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '97116983' AND txmzjzjlb.JZKSRQ BETWEEN '2006-12-08' AND '2015-10-12' AND txmzjzjlb.YLJGDM = '2605542' UNION SELECT COUNT(*) FROM hz_info JOIN ftxmzjzjlb ON... | css |
CREATE TABLE table_203_3 (
id number,
"province" text,
"capital" text,
"population" number,
"density" text,
"municipalities" text,
"legal districts" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which province has a lower population densi... | SELECT "province" FROM table_203_3 WHERE "province" IN ('almeria', 'jaen') ORDER BY "density" LIMIT 1 | squall |
CREATE TABLE table_name_39 (
place VARCHAR,
country VARCHAR,
to_par VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place in the United States has a To par of e?
| SELECT place FROM table_name_39 WHERE country = "united states" AND to_par = "e" | sql_create_context |
CREATE TABLE table_54440 (
"Party" text,
"Results 2004" text,
"CSA 5/14/09" text,
"Viavoice 5/15/09" text,
"Ifop- La Croix 5/15/09" text,
"Ipsos 5/16/09" text,
"OpinionWay 5/18/09" text,
"CSA 5/20/09" text,
"Ipsos 5/25/09" text,
"TNS-Sofres 5/26/09" text,
"OpinionWay 5/28/09"... | SELECT "TNS-Sofres 5/26/09" FROM table_54440 WHERE "Ipsos 5/25/09" = '1%' | wikisql |
CREATE TABLE perpetrator (
Perpetrator_ID int,
People_ID int,
Date text,
Year real,
Location text,
Country text,
Killed int,
Injured int
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
"Home Town" text
)
-- Using valid SQLite, answer the... | SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country | nvbench |
CREATE TABLE table_21342 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real,
"Competition" text,
"Man of the Match" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance at the game where Neil Lid... | SELECT MIN("Attendance") FROM table_21342 WHERE "Man of the Match" = 'Neil Liddiard' | 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 jybgb (
BBCJBW text,
BBDM tex... | SELECT wdmzjzjlb.CYZTDM FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '39258009864' UNION SELECT bdmzjzjlb.CYZTDM FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '39258009864' | css |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
Last... | SELECT CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, 'AmazonRDS' AS TagName, COUNT(*) AS PostCount FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE 'amazon-rds' GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORD... | sede |
CREATE TABLE table_73438 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "Regular Season Winner" FROM table_73438 WHERE "Tournament Winner" = 'Maryland' | wikisql |
CREATE TABLE table_name_87 (
home VARCHAR,
visitor VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which home team had a visitor of Chicago Black Hawks with a score of 2 3?
| SELECT home FROM table_name_87 WHERE visitor = "chicago black hawks" AND score = "2–3" | sql_create_context |
CREATE TABLE table_59395 (
"Frequency" real,
"Callsign" text,
"Brand" text,
"City of License" text,
"Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Brand, when Frequency is '640'?
| SELECT "Brand" FROM table_59395 WHERE "Frequency" = '640' | wikisql |
CREATE TABLE table_name_40 (
round VARCHAR,
opposing_team VARCHAR,
against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Round against Gillingham with an Against smaller than 3?
| SELECT round FROM table_name_40 WHERE opposing_team = "gillingham" AND against < 3 | sql_create_context |
CREATE TABLE table_76533 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Record of the game on September 6?
| SELECT "Record" FROM table_76533 WHERE "Date" = 'september 6' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) AND DATETIME(labevents.chartti... | mimic_iii |
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_CD, MED_ORG_DEPT_NM, AVG(IN_HOSP_DAYS) FROM t_kc21 WHERE MED_SER_ORG_NO = '7159417' GROUP BY MED_ORG_DEPT_CD ORDER BY AVG(IN_HOSP_DAYS) | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'anemia' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN... | eicu |
CREATE TABLE table_29686983_1 (
circuit VARCHAR,
fastest_lap VARCHAR,
winning_rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the circuit where the fastest lap is sam lowes and the winning rider is luca scassa?
| SELECT circuit FROM table_29686983_1 WHERE fastest_lap = "Sam Lowes" AND winning_rider = "Luca Scassa" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_64210 (
"Rank" real,
"Player" text,
"County" text,
"Tally" text,
"Total" real,
"Opposition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Tally of an Opposition of westmeath?
| SELECT "Tally" FROM table_64210 WHERE "Opposition" = 'westmeath' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE... | SELECT DISTINCT t.Id, t.TagName, t.Count, e.Body AS "Excerpt" FROM Tags AS t LEFT JOIN Posts AS e ON t.ExcerptPostId = e.Id GROUP BY t.Id, t.TagName, t.Count, e.Body ORDER BY t.Count DESC | sede |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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 te... | SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '韦英秀' AND mzjzjlb.JZKSRQ BETWEEN '2018-10-01' AND '2020-08-23') + (SELECT COUNT(*) FROM person_info J... | css |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_I... | SELECT SALARY, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_65944 (
"Peak" text,
"Country" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Col (m)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average prominence in m of pietrosul rodnei peak, which has an elevation less t... | SELECT AVG("Prominence (m)") FROM table_65944 WHERE "Peak" = 'pietrosul rodnei' AND "Elevation (m)" < '2,303' | wikisql |
CREATE TABLE table_26781017_1 (
motogp_winner VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many MotoGP winners were there when the circuit was Catalunya?
| SELECT COUNT(motogp_winner) FROM table_26781017_1 WHERE circuit = "Catalunya" | sql_create_context |
CREATE TABLE table_name_92 (
weight VARCHAR,
shape VARCHAR,
size VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the weight with the shape of scalloped, and that is a size of 20mm (across scallops)?
| SELECT weight FROM table_name_92 WHERE shape = "scalloped" AND size = "20mm (across scallops)" | sql_create_context |
CREATE TABLE table_14271 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Gold which has a Nation of australia, and a Bronze smaller than 1?
| SELECT MIN("Gold") FROM table_14271 WHERE "Nation" = 'australia' AND "Bronze" < '1' | wikisql |
CREATE TABLE table_name_3 (
country VARCHAR,
money___$__ VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What county has less than $188 and a score of 74-76-73-75=298?
| SELECT country FROM table_name_3 WHERE money___$__ < 188 AND score = 74 - 76 - 73 - 75 = 298 | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-23855')) AND vitalperiodic.respiration > 27.0 A... | eicu |
CREATE TABLE table_train_50 (
"id" int,
"raynaud_syndrome" bool,
"active_infection" bool,
"antibiotic_treatment" bool,
"receiving_vasopressor" bool,
"sepsis" bool,
"vasospastic_diathesis" bool,
"organ_failure" bool,
"septic_shock" bool,
"NOUSE" float
)
-- Using valid SQLite, an... | SELECT * FROM table_train_50 WHERE sepsis = 1 OR septic_shock = 1 | criteria2sql |
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperw... | SELECT stuid FROM sportsinfo GROUP BY stuid HAVING SUM(hoursperweek) > 10 | spider |
CREATE TABLE table_dev_33 (
"id" int,
"gender" string,
"fpg" float,
"active_infection" bool,
"uncontrolled_diabetes" bool,
"hiv_infection" bool,
"hemoglobin_a1c_hba1c" float,
"urine_albumin_excretion" int,
"hematocrit_hct" float,
"fasting_plasma_glucose" int,
"dietary_modific... | SELECT * FROM table_dev_33 WHERE (hematocrit_hct < 36 AND gender = 'male') OR (hematocrit_hct < 32 AND gender = 'female') | criteria2sql |
CREATE TABLE table_23748 (
"Date" text,
"Time" text,
"Big East Team" text,
"SEC Team" text,
"Location" text,
"Television" text,
"Attendance" real,
"Winner" text,
"Challenge Leader" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who w... | SELECT "Winner" FROM table_23748 WHERE "SEC Team" = 'LSU' | wikisql |
CREATE TABLE table_28802165_1 (
s_acre INTEGER,
civil_parish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum acres in Castledermot?
| SELECT MAX(s_acre) FROM table_28802165_1 WHERE civil_parish = "Castledermot" | sql_create_context |
CREATE TABLE table_name_72 (
oilers_points INTEGER,
opponent VARCHAR,
opponents VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Oilers points have an Opponent of san francisco 49ers, and Opponents larger than 19?
| SELECT MAX(oilers_points) FROM table_name_72 WHERE opponent = "san francisco 49ers" AND opponents > 19 | sql_create_context |
CREATE TABLE table_name_77 (
week INTEGER,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week had the highest attendance with 58,701?
| SELECT MAX(week) FROM table_name_77 WHERE attendance = "58,701" | sql_create_context |
CREATE TABLE table_22977424_8 (
name VARCHAR,
promoted_to_league VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the name for plymouth albion orrell
| SELECT name FROM table_22977424_8 WHERE promoted_to_league = "Plymouth Albion Orrell" | sql_create_context |
CREATE TABLE table_177273_2 (
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the lowest year represented?
| SELECT MIN(year) FROM table_177273_2 | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH ... | SELECT COUNT(*) FROM zyjzjlb WHERE JZKSDM = '8477' AND RYDJSJ BETWEEN '2010-02-06' AND '2020-04-25' | css |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '陶国兴' UNION SELECT zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb... | css |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_it... | mimic_iii |
CREATE TABLE table_19149550_9 (
rank VARCHAR,
total_asian_population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many boroughs with different ranks have a total Asian population of 33338?
| SELECT COUNT(rank) FROM table_19149550_9 WHERE total_asian_population = 33338 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.