instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_24566 (
"Country" text,
"% of imports from Russia" text,
"% cut" text,
"Diversification" text,
"Gas storage" text,
"Alternative fuel" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the percent cunt for the nation that... | SELECT "% cut" FROM table_24566 WHERE "Alternative fuel" = 'Fuel oil stocks need only for industry' | wikisql |
CREATE TABLE table_name_58 (
written_by VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the episode that was directed by Terry Ingram?
| SELECT written_by FROM table_name_58 WHERE directed_by = "terry ingram" | sql_create_context |
CREATE TABLE table_name_48 (
city___state VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city was the circuit of mallala motor sport park?
| SELECT city___state FROM table_name_48 WHERE circuit = "mallala motor sport park" | sql_create_context |
CREATE TABLE table_204_567 (
id number,
"team" text,
"location" text,
"stadium" text,
"capacity" number,
"manager" text,
"captain" text,
"kit manufacturer" text,
"shirt sponsor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- of those... | SELECT "team" FROM table_204_567 WHERE "kit manufacturer" = 'nike' ORDER BY "capacity" DESC LIMIT 1 | squall |
CREATE TABLE table_name_79 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for the away team of north melbourne?
| SELECT away_team AS score FROM table_name_79 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE chip_model (
model_name text,
launch_year number,
ram_mib number,
rom_mib number,
slots text,
wifi text,
bluetooth text
)
CREATE TABLE screen_mode (
graphics_mode number,
char_cells text,
pixels text,
hardware_colours number,
used_kb number,
map text,
... | SELECT AVG(ram_mib) FROM chip_model WHERE NOT model_name IN (SELECT chip_model FROM phone) | spider |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
... | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '任斯伯' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2019-07-16') | css |
CREATE TABLE table_26904 (
"Team" text,
"Slogan" text,
"Match1" real,
"Match2" real,
"Match3" real,
"Match4" real,
"Match5" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest score for match 2 where the scor... | SELECT MAX("Match2") FROM table_26904 WHERE "Match4" = '0' AND "Total" = '5' | wikisql |
CREATE TABLE table_15038 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest year that has no more than 0 points?
| SELECT MAX("Year") FROM table_15038 WHERE "Points" < '0' | 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 t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7767561' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-04-25' AND '2002-05-18' AND t_kc21.INSURED_STS = '未就业' | css |
CREATE TABLE table_56614 (
"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 did the home team score when the away team ... | SELECT "Home team score" FROM table_56614 WHERE "Away team score" = '14.15 (99)' | wikisql |
CREATE TABLE table_46206 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is To Par, when Year(s) Won is '1968 , 1971'?
| SELECT "To par" FROM table_46206 WHERE "Year(s) won" = '1968 , 1971' | wikisql |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_N... | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry | nvbench |
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | SELECT id, duration FROM trip ORDER BY duration DESC LIMIT 3 | nvbench |
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_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '章恺乐' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3006.5) | css |
CREATE TABLE table_9542 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did the player who won in 1965 finish?
| SELECT "Finish" FROM table_9542 WHERE "Year(s) won" = '1965' | wikisql |
CREATE TABLE department (
dno number,
division text,
dname text,
room text,
building text,
dphone number
)
CREATE TABLE minor_in (
stuid number,
dno number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
adv... | SELECT rank FROM faculty GROUP BY rank ORDER BY COUNT(*) LIMIT 1 | spider |
CREATE TABLE table_72050 (
"Year" real,
"Office" text,
"Candidate" text,
"Popular Votes" real,
"Percentage" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many votes did candice sjostrom receive?
| SELECT AVG("Popular Votes") FROM table_72050 WHERE "Candidate" = 'candice sjostrom' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "14" AND lab.label = "CD4 Cells, Percent" | mimicsql_data |
CREATE TABLE table_68550 (
"Wrestlers" text,
"Reign" text,
"Days held" text,
"Location" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the wrestlers with days held of 428
| SELECT "Wrestlers" FROM table_68550 WHERE "Days held" = '428' | wikisql |
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 Team_ID, School_ID FROM basketball_match GROUP BY ACC_Home | nvbench |
CREATE TABLE table_name_26 (
chassis VARCHAR,
tyres VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Chassis has g Tyres before 1987?
| SELECT chassis FROM table_name_26 WHERE tyres = "g" AND year < 1987 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
c... | SELECT MIN(vitalperiodic.systemicdiastolic) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-23341') AND NOT patient.unitdischargetim... | eicu |
CREATE TABLE table_68548 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" text,
"Finish" text,
"Entrant" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the chassis for offy engine and 25th finish?
| SELECT "Chassis" FROM table_68548 WHERE "Engine" = 'offy' AND "Finish" = '25th' | wikisql |
CREATE TABLE table_18085 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the follo... | SELECT "Points for" FROM table_18085 WHERE "Points" = '52' | wikisql |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE city (
city_code varchar,
city_na... | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'BOSTON' AND ground_service.airpor... | atis |
CREATE TABLE table_name_52 (
college_junior_club_team__league_ VARCHAR,
nationality VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What College/Junior/Club Team (League) from Canada has a round smaller than 3?
| SELECT college_junior_club_team__league_ FROM table_name_52 WHERE nationality = "canada" AND round < 3 | sql_create_context |
CREATE TABLE aircraft (
aircraft_id number,
aircraft text,
description text,
max_gross_weight text,
total_disk_area text,
max_disk_loading text
)
CREATE TABLE pilot (
pilot_id number,
name text,
age number
)
CREATE TABLE airport (
airport_id number,
airport_name text,
t... | SELECT T1.aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.aircraft_id = T2.aircraft_id JOIN airport AS T3 ON T2.airport_id = T3.airport_id WHERE T3.airport_name = "London Heathrow" INTERSECT SELECT T1.aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.aircraft_id = T2.aircraft_id JOIN airport... | spider |
CREATE TABLE table_name_69 (
losses INTEGER,
wins VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of losses for entries with 15 wins and a position larger than 3?
| SELECT SUM(losses) FROM table_name_69 WHERE wins = 15 AND position > 3 | sql_create_context |
CREATE TABLE table_24288 (
"Day" text,
"Stage" text,
"Time (GMT)" text,
"Name" text,
"Length" text,
"Winner" text,
"Time" text,
"Avg. spd." text,
"Rally leader" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many stages of the ra... | SELECT COUNT("Length") FROM table_24288 WHERE "Time" = '14:33.9' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate t... | SELECT DISTINCT MyBadges.Name, (SELECT COUNT(*) FROM Badges WHERE Badges.Name = MyBadges.Name) AS TotalCount FROM Badges AS MyBadges WHERE MyBadges.UserId = '##UserId##' ORDER BY TotalCount | sede |
CREATE TABLE table_41636 (
"Driver" text,
"NOR 1" text,
"NOR 2" text,
"ZAN 1" text,
"ZAN 2" text,
"N\u00dcR 1" text,
"N\u00dcR 2" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What driver has 19 as the zan 1?
| SELECT "Driver" FROM table_41636 WHERE "ZAN 1" = '19' | wikisql |
CREATE TABLE table_3109 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did the episode with a production code of 4... | SELECT "Original air date" FROM table_3109 WHERE "Production code" = '447004' | wikisql |
CREATE TABLE table_65951 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the athlete from Germany with notes of Q?
| SELECT "Athlete" FROM table_65951 WHERE "Notes" = 'q' AND "Country" = 'germany' | wikisql |
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gp... | SELECT COUNT(DISTINCT school_code) FROM department | spider |
CREATE TABLE Products (
product_id INTEGER,
product_type_code VARCHAR(15),
product_name VARCHAR(80),
product_price DOUBLE
)
CREATE TABLE Addresses (
address_id INTEGER,
line_1_number_building VARCHAR(80),
city VARCHAR(50),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),... | SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name | nvbench |
CREATE TABLE table_22771048_3 (
transit_connections VARCHAR,
station VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the transit connections for capitol hill u
| SELECT transit_connections FROM table_22771048_3 WHERE station = "Capitol Hill U" | sql_create_context |
CREATE TABLE table_51540 (
"Pick" real,
"Player" text,
"Country of origin*" text,
"PBA team" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many picks went to College of Letran?
| SELECT COUNT("Pick") FROM table_51540 WHERE "College" = 'letran' | wikisql |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JY... | css |
CREATE TABLE table_16834 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player is from Marshall and played 1974-75?
| SELECT "Player" FROM table_16834 WHERE "Years for Jazz" = '1974-75' AND "School/Club Team" = 'Marshall' | wikisql |
CREATE TABLE table_4568 (
"Higher harmonics" text,
"Darwin" text,
"Period" text,
"Speed" text,
"Doodson coefficients" text,
"NOAA" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the NOAA of the higher harmonics that have a Darwin of m sf... | SELECT "NOAA" FROM table_4568 WHERE "Darwin" = 'm sf' | 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 ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%alborz%' OR UPPER(Location) LIKE '%ALBORZ%' OR LOWER(Location) LIKE '%karaj%' OR UPPER(Location) LIKE '%KARAJ%' ORDER BY Reputation DESC | sede |
CREATE TABLE table_name_72 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the score for 30 april 1977
| SELECT score FROM table_name_72 WHERE date = "30 april 1977" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
... | 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 = 18866) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i... | mimic_iii |
CREATE TABLE assignedto (
scientist number,
project text
)
CREATE TABLE projects (
code text,
name text,
hours number
)
CREATE TABLE scientists (
ssn number,
name text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the names of project... | SELECT name FROM projects WHERE NOT code IN (SELECT project FROM assignedto) | spider |
CREATE TABLE table_name_79 (
event VARCHAR,
year VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event is before 1964 and has an athlete of l szl t bori gunnar nielsen?
| SELECT event FROM table_name_79 WHERE year < 1964 AND athlete = "lászló tábori gunnar nielsen" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT Id AS "post_link", OwnerUserId AS "user_link", CreationDate, Tags FROM Posts WHERE AnswerCount = 0 AND CommentCount < 2 AND Score = 0 AND ClosedDate IS NULL AND DATEDIFF(DAY, CreationDate, GETDATE()) > 350 AND DATEDIFF(DAY, CreationDate, GETDATE()) < 375 AND (Tags LIKE '%<category-theory>%' OR Tags LIKE '%<simpl... | sede |
CREATE TABLE table_11891841_2 (
type VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the type where the country is esp?
| SELECT type FROM table_11891841_2 WHERE country = "ESp" | sql_create_context |
CREATE TABLE table_67201 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country for the player Tiger Woods?
| SELECT "Country" FROM table_67201 WHERE "Player" = 'tiger woods' | wikisql |
CREATE TABLE table_name_47 (
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average first prize of the tournament with a score of 279 ( 9)?
| SELECT AVG(1 AS st_prize___) AS $__ FROM table_name_47 WHERE score = "279 (–9)" | sql_create_context |
CREATE TABLE table_20466963_4 (
date VARCHAR,
presenter VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the episode in which the presenter is Johnny Vaughan?
| SELECT date FROM table_20466963_4 WHERE presenter = "Johnny Vaughan" | sql_create_context |
CREATE TABLE table_34063 (
"Name" text,
"Years" text,
"Seasons" real,
"Lost" real,
"Pct." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many seasons did Charles C. Farrell coach?
| SELECT COUNT("Seasons") FROM table_34063 WHERE "Name" = 'charles c. farrell' | wikisql |
CREATE TABLE table_59830 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total attendance with a 1-0 result, at Venue H, and Round SF?
| SELECT SUM("Attendance") FROM table_59830 WHERE "Result" = '1-0' AND "Venue" = 'h' AND "Round" = 'sf' | wikisql |
CREATE TABLE table_name_84 (
record VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Laker's record when they played against Kansas City Kings?
| SELECT record FROM table_name_84 WHERE opponent = "kansas city kings" | sql_create_context |
CREATE TABLE table_name_13 (
time VARCHAR,
local_networked VARCHAR,
ad_freq VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time that is networked has an ad freq of 20 minutes until 7pm?
| SELECT time FROM table_name_13 WHERE local_networked = "networked" AND ad_freq = "20 minutes until 7pm" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDat... | SELECT u.Id AS "user_link", SUM(LENGTH(p.Body)) AS "characters_typed", u.Reputation AS "reputation_they_got_for_it" FROM Users AS U JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE u.DisplayName LIKE 'bibh%' GROUP BY u.Id, u.Reputation ORDER BY 'characters_typed' DESC | sede |
CREATE TABLE table_204_589 (
id number,
"season" text,
"tier" number,
"division" text,
"pos." text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which division is listed only once ?
| SELECT "division" FROM table_204_589 GROUP BY "division" HAVING COUNT(*) = 1 | squall |
CREATE TABLE table_225099_3 (
state__class_ VARCHAR,
reason_for_change VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the state for reason for change is resigned may 15, 1820?
| SELECT state__class_ FROM table_225099_3 WHERE reason_for_change = "Resigned May 15, 1820" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... | eicu |
CREATE TABLE table_name_97 (
date VARCHAR,
pilot VARCHAR,
type VARCHAR,
record_description VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Type of mi-10r, and a Record description of altitude with kg (lb) payload, and a Pilot of g.v. alfyorov is what ... | SELECT date FROM table_name_97 WHERE type = "mi-10r" AND record_description = "altitude with kg (lb) payload" AND pilot = "g.v. alfyorov" | sql_create_context |
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
-- Using valid SQLite... | SELECT allergy FROM has_allergy GROUP BY allergy ORDER BY COUNT(*) DESC LIMIT 1 | spider |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2165" AND diagnoses.icd9_code = "V1083" | mimicsql_data |
CREATE TABLE table_17880 (
"No" real,
"Player" text,
"Height" text,
"Position" text,
"Year born" real,
"Current Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the player born who is 2.02m tall?
| SELECT MAX("Year born") FROM table_17880 WHERE "Height" = '2.02' | wikisql |
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 COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-72608')) AND medication.drugname = 'ondansetron 2 mg/1 ml 2ml sdv inj'... | eicu |
CREATE TABLE table_57254 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the record for 21 january 2008
| SELECT "Record" FROM table_57254 WHERE "Date" = '21 january 2008' | wikisql |
CREATE TABLE table_204_210 (
id number,
"rnd" number,
"circuit" text,
"lmp1 winning team\nlmp1 winning drivers" text,
"lmp2 winning team\nlmp2 winning drivers" text,
"gt1 winning team\ngt1 winning drivers" text,
"gt2 winning team\ngt2 winning drivers" text,
"results" text
)
-- Using va... | SELECT COUNT(DISTINCT "circuit") FROM table_204_210 | squall |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT SG, TZ, TW, SSY, SZY, XL, HXPLC, ML FROM mzjzjlb WHERE JZLSH = '41170186435' | css |
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 zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT mzjzjlb.SG, mzjzjlb.TZ, mzjzjlb.TW, mzjzjlb.SSY, mzjzjlb.SZY, mzjzjlb.XL, mzjzjlb.HXPLC, mzjzjlb.ML FROM mzjzjlb WHERE mzjzjlb.JZLSH = '41170186435' | css |
CREATE TABLE table_name_12 (
attendance VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the total number of attendance for week of 16
| SELECT COUNT(attendance) FROM table_name_12 WHERE week = 16 | sql_create_context |
CREATE TABLE table_30599 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the episo... | SELECT "Written by" FROM table_30599 WHERE "Directed by" = 'Peter O''Fallon' | wikisql |
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 student_record ON student_record.course_id = course.course_id INNER JOIN area ON student_record.course_id = area.course_id WHERE area.area LIKE '%hardware%' AND student_record.student_id = 1 | advising |
CREATE TABLE table_14345690_2 (
entered VARCHAR,
finished VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the 4th finisher enter?
| SELECT entered FROM table_14345690_2 WHERE finished = "4th" | sql_create_context |
CREATE TABLE table_2668336_19 (
candidates VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the candidates in the election where william wilson was the incumbent?
| SELECT candidates FROM table_2668336_19 WHERE incumbent = "William Wilson" | sql_create_context |
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 patients (
row_id n... | SELECT AVG(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20000)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... | mimic_iii |
CREATE TABLE table_54870 (
"Party" text,
"Results 2004" text,
"Ifop 11/12/08" text,
"Ifop 1/9/09" text,
"Ipsos 3/14/09" text,
"CSA 4/16/09" text,
"OpinionWay 4/17/09" text,
"Ifop 4/24/09" text,
"Ipsos 5/2/09" text,
"Ifop 5/11/09" text,
"OpinionWay 5/11/09" text
)
-- Using v... | SELECT "Ifop 4/24/09" FROM table_54870 WHERE "OpinionWay 4/17/09" = '5%' AND "Party" = 'left front' | wikisql |
CREATE TABLE institution (
TYPE VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all the distinct institution types.
| SELECT DISTINCT TYPE FROM institution | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) 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 mzjzjlb.JZZDSM = '阿尔茨海默病' GROUP BY person_info.JGDM | css |
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
... | SELECT DEPT_NAME, COUNT(*) FROM STUDENT AS T1 JOIN DEPARTMENT AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.DEPT_CODE ORDER BY COUNT(*) DESC LIMIT 3 | nvbench |
CREATE TABLE Customer_Address_History (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Contacts (
contact_id INTEGER,
customer_id INTEGER,
gender VARCHAR(1),
first_name VARCHAR(80),
last_name VARCHAR(50),
contact_phone VARCHAR(80)
)
... | SELECT state_province_county, COUNT(*) FROM Addresses GROUP BY state_province_county ORDER BY state_province_county DESC | nvbench |
CREATE TABLE table_73161 (
"Rnd" real,
"Race Name" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the report of the race won by Micha... | SELECT "Report" FROM table_73161 WHERE "Winning driver" = 'Michael Andretti' AND "Fastest lap" = 'Nigel Mansell' | wikisql |
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 zyjybgb.SQRGH, zyjybgb.SQRXM FROM zyjybgb WHERE zyjybgb.BGDH = '51684992743' UNION SELECT mzjybgb.SQRGH, mzjybgb.SQRXM FROM mzjybgb WHERE mzjybgb.BGDH = '51684992743' | css |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
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 t... | SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSDM = '19305' AND zyjzjlb.RYDJSJ BETWEEN '2002-04-26' AND '2011-01-19' | css |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program (
program_id int,
name v... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE (COURSE_1.number = 700 OR COURSE_1.number = 650) AND COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.depar... | advising |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC | nvbench |
CREATE TABLE table_name_61 (
as_of_september_1 VARCHAR,
_2012 VARCHAR,
vs_all VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What occurrs as of September 1, 2012 when the value for vs. all is 65.47%?
| SELECT as_of_september_1, _2012 FROM table_name_61 WHERE vs_all = "65.47%" | sql_create_context |
CREATE TABLE table_11340432_1 (
information VARCHAR,
shadow_ridge VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many informations does Michael Hawkins have?
| SELECT COUNT(information) FROM table_11340432_1 WHERE shadow_ridge = "Michael Hawkins" | sql_create_context |
CREATE TABLE Project_Staff (
date_from VARCHAR,
date_to VARCHAR,
role_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When do all the researcher role staff start to work, and when do they stop working?
| SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'researcher' | sql_create_context |
CREATE TABLE table_name_4 (
opponent VARCHAR,
game VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What opponent has a game less than 6, and april 17 as the date?
| SELECT opponent FROM table_name_4 WHERE game < 6 AND date = "april 17" | sql_create_context |
CREATE TABLE room (
blockfloor VARCHAR,
blockcode VARCHAR
)
CREATE TABLE BLOCK (
blockfloor VARCHAR,
blockcode VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of rooms located on each block floor.
| SELECT COUNT(*), T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockfloor | sql_create_context |
CREATE TABLE railway (
Railway_ID int,
Railway text,
Builder text,
Built text,
Wheels text,
Location text,
ObjectNumber text
)
CREATE TABLE train (
Train_ID int,
Train_Num text,
Name text,
From text,
Arrival text,
Railway_ID int
)
CREATE TABLE railway_manage (
R... | SELECT Name, COUNT(Name) FROM train GROUP BY Name | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "3972" AND prescriptions.route = "INHALATION" | mimicsql_data |
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts | nvbench |
CREATE TABLE table_39680 (
"Year" text,
"Title" text,
"Role" text,
"Language" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which title had Notes of 8 episodes?
| SELECT "Title" FROM table_39680 WHERE "Notes" = '8 episodes' | 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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'P55.131' AND jyjgzbb.JCZBDM = '143654' UNION SELECT jyjgzbb.CKZFWX... | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND procedures.icd9_code = "5361" | mimicsql_data |
CREATE TABLE table_5007 (
"Designation" text,
"Type" text,
"Length overall" text,
"Launch weight" text,
"Warhead weight" text,
"Range" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the overall length with a designation of s-8ko?
| SELECT "Length overall" FROM table_5007 WHERE "Designation" = 's-8ko' | 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 demographic.language FROM demographic WHERE demographic.subject_id = "91588" | mimicsql_data |
CREATE TABLE table_name_63 (
city VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city is in the country of Mayotte?
| SELECT city FROM table_name_63 WHERE country = "mayotte" | sql_create_context |
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 wdmzjzjlb (
CYBQDM text,
CYBQ... | SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '90180222' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2021-06-07') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN... | css |
CREATE TABLE table_71804 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Player has a To par of +1 and the Score 75-70-71-73=289?
| SELECT "Player" FROM table_71804 WHERE "To par" = '+1' AND "Score" = '75-70-71-73=289' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.