instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_203_482 (
id number,
"year" number,
"award" text,
"result" text,
"category" text,
"series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many awards were won ?
| SELECT COUNT("award") FROM table_203_482 WHERE "result" = 'won' | squall |
CREATE TABLE table_53092 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date for the venue of brunswick street oval
| SELECT "Date" FROM table_53092 WHERE "Venue" = 'brunswick street oval' | wikisql |
CREATE TABLE zyb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '60431090' AND t_kc22.STA_DATE BETWEEN '2012-04-21' AND '2017-06-10' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '6... | css |
CREATE TABLE table_name_51 (
turkish VARCHAR,
bangla VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Turkish word for the Bangla word shombar ?
| SELECT turkish FROM table_name_51 WHERE bangla = "shombar সোমবার" | sql_create_context |
CREATE TABLE table_32375 (
"Season" text,
"Team" text,
"League Apps" real,
"League Goals" real,
"Cup Apps" real,
"Cup Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What season saw 6 cup apps and 5 cup goals?
| SELECT "Season" FROM table_32375 WHERE "Cup Apps" = '6' AND "Cup Goals" = '5' | wikisql |
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
-- Using valid SQLite, answer... | SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team | nvbench |
CREATE TABLE table_171748_3 (
period VARCHAR,
_percentage_trains_arriving_within_5_mins_of_scheduled_time_moving_annual_average__maa_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the percentage of trains arriving within 5 minutes of scheduled time... | SELECT period FROM table_171748_3 WHERE _percentage_trains_arriving_within_5_mins_of_scheduled_time_moving_annual_average__maa_ = "89.6%" | sql_create_context |
CREATE TABLE table_15304 (
"Year" text,
"Venue" text,
"Winners" text,
"2nd place" text,
"3rd place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Venue has a Year of 2005?
| SELECT "Venue" FROM table_15304 WHERE "Year" = '2005' | wikisql |
CREATE TABLE track (
track_id number,
name text,
location text,
seating number,
year_opened number
)
CREATE TABLE race (
race_id number,
name text,
class text,
date text,
track_id text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT name, location, year_opened FROM track WHERE seating > (SELECT AVG(seating) FROM track) | spider |
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age int
)
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of text
)
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year ... | SELECT Country, COUNT(Country) FROM people WHERE Age < (SELECT AVG(Age) FROM people) GROUP BY Country ORDER BY Country DESC | nvbench |
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 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 = '0652199' AND gwyjzb.OUT_DIAG_DIS_CD = 'H88.444' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '0652199' AND fgwyjzb.OUT_D... | css |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE ... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci... | atis |
CREATE TABLE table_204_384 (
id number,
"#" number,
"air date" text,
"timeslot (est)" text,
"season" text,
"rating" number,
"share" number,
"18-49 (rating/share)" text,
"viewers (m)" number,
"weekly rank (#)" number
)
-- Using valid SQLite, answer the following questions for th... | SELECT "air date" FROM table_204_384 ORDER BY "viewers (m)" DESC LIMIT 1 | squall |
CREATE TABLE table_76330 (
"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 w... | SELECT "Score" FROM table_76330 WHERE "Game" = '48' | wikisql |
CREATE TABLE table_name_12 (
player VARCHAR,
to_par VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Player has a To par of +5 with a Score of 70-70-71-74=285?
| SELECT player FROM table_name_12 WHERE to_par = "+5" AND score = 70 - 70 - 71 - 74 = 285 | sql_create_context |
CREATE TABLE table_69699 (
"Name" text,
"Championship" real,
"League Cup" real,
"FA Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many league cups associated with under 10 championships and a total of under 3?
| SELECT SUM("League Cup") FROM table_69699 WHERE "Championship" < '10' AND "Total" < '3' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | SELECT DisplayName, DownVotes, UpVotes FROM Users WHERE DownVotes > 1 ORDER BY DownVotes DESC | sede |
CREATE TABLE table_19617 (
"DVD name" text,
"Episodes" real,
"Region 1 (CAN)" text,
"Region 1 (US)" text,
"Region 2 (FR)" text,
"Region 4" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes were put out in Region 4 on March 4, 2010... | SELECT MAX("Episodes") FROM table_19617 WHERE "Region 4" = 'March 4, 2010' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753')) AND intakeoutput.cellpath LIKE '%output... | eicu |
CREATE TABLE table_11119 (
"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 was the largest crowd when Collingwood was ... | SELECT MAX("Crowd") FROM table_11119 WHERE "Away team" = 'collingwood' | wikisql |
CREATE TABLE table_name_63 (
date VARCHAR,
decision VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has a Decision of osgood, and a Score of 3 4?
| SELECT date FROM table_name_63 WHERE decision = "osgood" AND score = "3 – 4" | sql_create_context |
CREATE TABLE table_11695215_1 (
title VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode was writted by John A. Norris?
| SELECT title FROM table_11695215_1 WHERE written_by = "John A. Norris" | sql_create_context |
CREATE TABLE table_29421 (
"R" real,
"Player" text,
"Position" text,
"The Championship" real,
"FA Cup" real,
"League Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the R when the total is 1 and the position is fw?
| SELECT "R" FROM table_29421 WHERE "Total" = '1' AND "Position" = 'FW' | wikisql |
CREATE TABLE table_60817 (
"Year" real,
"Grand Slam" text,
"Round" text,
"Winner" text,
"Loser" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which year did Misaki Doi lose the Australian Open Grand Slam?
| SELECT SUM("Year") FROM table_60817 WHERE "Grand Slam" = 'australian open' AND "Loser" = 'misaki doi' | wikisql |
CREATE TABLE table_1015521_2 (
rank_in_spanish VARCHAR,
rank_in_english VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If you get a ranking as major in the english military then what would the spanish military address you as?
| SELECT rank_in_spanish FROM table_1015521_2 WHERE rank_in_english = "Major" | sql_create_context |
CREATE TABLE table_204_132 (
id number,
"year" number,
"location" text,
"men's individual" text,
"women's individual" text,
"men's team" text,
"women's team" text,
"mixed team" text,
"ref" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT "men's team" FROM table_204_132 GROUP BY "men's team" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_name_14 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date when the record was 35-57?
| SELECT date FROM table_name_14 WHERE record = "35-57" | sql_create_context |
CREATE TABLE table_name_96 (
fcc_info VARCHAR,
erp_w VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What FCC info is listed for the ERP W of 2?
| SELECT fcc_info FROM table_name_96 WHERE erp_w = 2 | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE table_48810 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place is the United States in that has a score of 68-73-68=209?
| SELECT "Place" FROM table_48810 WHERE "Country" = 'united states' AND "Score" = '68-73-68=209' | wikisql |
CREATE TABLE table_name_54 (
frequency_mhz VARCHAR,
erp_w VARCHAR,
class VARCHAR,
call_sign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of frequency Mhz with class of d and call sign of k201bm and ERP W less than 74
| SELECT COUNT(frequency_mhz) FROM table_name_54 WHERE class = "d" AND call_sign = "k201bm" AND erp_w < 74 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "43" | mimicsql_data |
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 * FROM qtb WHERE qtb.MED_SER_ORG_NO = '5003066' AND qtb.IN_HOSP_DATE BETWEEN '2012-10-01' AND '2019-11-24' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '5003066' AND gyb.IN_HOSP_DATE BETWEEN '2012-10-01' AND '2019-11-24' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '5003066' AND zyb.IN_HOSP_DATE BETW... | css |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
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 tim... | SELECT mzjzjlb.JZLSH 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.RYBH = '41068843' AND hz_info.YLJGDM = '5511402' AND NOT mzjzjlb.JZKSMC LIKE '%肠镜%' | css |
CREATE TABLE table_14342367_13 (
player VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players are from Sioux City, Iowa?
| SELECT COUNT(player) FROM table_14342367_13 WHERE hometown = "Sioux City, Iowa" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "8440" | mimicsql_data |
CREATE TABLE table_name_57 (
chinese_title VARCHAR,
album_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Album # of 3rd is what chinese title?
| SELECT chinese_title FROM table_name_57 WHERE album_number = "3rd" | sql_create_context |
CREATE TABLE table_name_13 (
entrant VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which entrant has a Dallara F398 chassis?
| SELECT entrant FROM table_name_13 WHERE chassis = "dallara f398" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID ... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_12 (
semifinalists VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the semifinalist for the Key Biscane tournament?
| SELECT semifinalists FROM table_name_12 WHERE tournament = "key biscane" | sql_create_context |
CREATE TABLE table_name_20 (
score VARCHAR,
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the score for the mariners opponent on may 10
| SELECT score FROM table_name_20 WHERE opponent = "mariners" AND date = "may 10" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE i... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'low cardiac output state' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), ... | eicu |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskResults (
Id number,
Review... | SELECT DisplayName, Id, Reputation, Age, CreationDate FROM Users GROUP BY DisplayName, Id, Reputation, Age, CreationDate | sede |
CREATE TABLE table_26847237_3 (
home_team VARCHAR,
round__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the home team when the round # is round 1?
| SELECT home_team FROM table_26847237_3 WHERE round__number = "Round 1" | sql_create_context |
CREATE TABLE table_50484 (
"Election" real,
"Candidate" text,
"Running mate" text,
"Total votes" real,
"Share of votes" text,
"Outcome" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many votes did Lee Teng-Hui receive when he was elected?
| SELECT MAX("Total votes") FROM table_50484 WHERE "Outcome" = 'elected' AND "Candidate" = 'lee teng-hui' | wikisql |
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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | SELECT EMPLOYEE_ID, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
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 COUNT(DISTINCT MED_SER_ORG_NO) FROM t_kc21 WHERE PERSON_NM = '姜静姝' AND IN_HOSP_DATE BETWEEN '2005-07-09' AND '2019-11-21' | css |
CREATE TABLE table_name_43 (
constructor VARCHAR,
laps VARCHAR,
time_retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which constructor has laps less than 100 and a time/retired +10 laps?
| SELECT constructor FROM table_name_43 WHERE laps < 100 AND time_retired = "+10 laps" | sql_create_context |
CREATE TABLE zyb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '马浩浩' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 459.68) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '马浩浩' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT ... | css |
CREATE TABLE table_36033 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Tournament has a Score of 3 6 6 4 4 6?
| SELECT "Tournament" FROM table_36033 WHERE "Score" = '3–6 6–4 4–6' | wikisql |
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor text,
comptroller text,
attorney_general text,
us_senate text
)
CREATE TABLE el... | SELECT T1.delegate, T2.party FROM election AS T1 JOIN party AS T2 ON T1.party = T2.party_id | spider |
CREATE TABLE table_name_16 (
episode VARCHAR,
production_code VARCHAR,
season VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which episode was directed by Bob Anderson with a production code of KABF16 and a season before than 25?... | SELECT episode FROM table_name_16 WHERE season < 25 AND directed_by = "bob anderson" AND production_code = "kabf16" | sql_create_context |
CREATE TABLE table_64209 (
"Frequency" text,
"Station" text,
"Operator" text,
"Country of origin" text,
"Transmitter location" text,
"Format" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which station is from China and has a frequency of 684kh... | SELECT "Station" FROM table_64209 WHERE "Country of origin" = 'china' AND "Frequency" = '684khz' | wikisql |
CREATE TABLE table_939 (
"Number" real,
"Astronaut" text,
"Agency" text,
"Total EVAs" real,
"Total Time Hours:Minutes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What agency does Anderson Clayton Anderson work for?
| SELECT "Agency" FROM table_939 WHERE "Astronaut" = 'Anderson Clayton Anderson' | wikisql |
CREATE TABLE table_18316 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many parties are there in races involving Dawson Mathis?
| SELECT COUNT("Party") FROM table_18316 WHERE "Incumbent" = 'Dawson Mathis' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Septic shock" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_26011 (
"Branding" text,
"Callsign" text,
"Ch. #" text,
"Power kW" text,
"Station Type" text,
"Location (Transmitter site)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When relay is the station type and 5kw is the power kw ... | SELECT "Branding" FROM table_26011 WHERE "Power kW" = '5kW' AND "Station Type" = 'Relay' | wikisql |
CREATE TABLE table_61193 (
"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.
-- Which year was won with a finish of 68
| SELECT "Year(s) won" FROM table_61193 WHERE "Finish" = '68' | wikisql |
CREATE TABLE table_name_98 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the match on July 22, 2008?
| SELECT score FROM table_name_98 WHERE date = "july 22, 2008" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Private" AND lab.label = "Immunoglobulin M" | mimicsql_data |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849')) AND STRFTIME('%y', treatment.treatmenttime) >= '2102' ... | eicu |
CREATE TABLE table_name_39 (
venue VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the venue for record of 2-7
| SELECT venue FROM table_name_39 WHERE record = "2-7" | sql_create_context |
CREATE TABLE table_45458 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many picks does Auburn have?
| SELECT COUNT("Pick") FROM table_45458 WHERE "School/Club Team" = 'auburn' | wikisql |
CREATE TABLE table_22665 (
"Doctor" text,
"Season" text,
"Story no." text,
"Serial" text,
"Number of episodes" text,
"Total footage remaining from missing episodes (mm:ss)" text,
"Missing episodes with recovered footage" text,
"Country/Territory" text,
"Source" text,
"Format" tex... | SELECT "Country/Territory" FROM table_22665 WHERE "Story no." = '032' AND "Missing episodes with recovered footage" = 'Episode 4' | wikisql |
CREATE TABLE table_67678 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT MIN("Played") FROM table_67678 WHERE "Position" = '2' AND "Goals against" > '53' | wikisql |
CREATE TABLE financial_transactions (
transaction_id number,
previous_transaction_id number,
account_id number,
card_id number,
transaction_type text,
transaction_date time,
transaction_amount number,
transaction_comment text,
other_transaction_details text
)
CREATE TABLE customers ... | SELECT customer_id, COUNT(*) FROM accounts GROUP BY customer_id | spider |
CREATE TABLE table_name_24 (
pick VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the pick in 2004?
| SELECT pick FROM table_name_24 WHERE year = 2004 | sql_create_context |
CREATE TABLE table_20199 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years did the player who's school is Clemson spend in Orla... | SELECT "Years in Orlando" FROM table_20199 WHERE "School/Club Team" = 'Clemson' | wikisql |
CREATE TABLE table_42561 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest number of laps for Team Green when the grid is 1?
| SELECT MIN("Laps") FROM table_42561 WHERE "Team" = 'team green' AND "Grid" = '1' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE table_name_39 (
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the production in 2010 with rank of 8?
| SELECT 2010 FROM table_name_39 WHERE rank = "8" | 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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.short_title = "Ocl crtd art wo infrct" | mimicsql_data |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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 JOB_ID, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Malignant neoplasm of other sites of tongue" AND prescriptions.route = "NU" | mimicsql_data |
CREATE TABLE table_name_85 (
wins INTEGER,
byes VARCHAR,
against VARCHAR,
golden_rivers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Wins, when Against is less than 1033, when Golden Rivers is 'Nullawil', and when Byes is less th... | SELECT SUM(wins) FROM table_name_85 WHERE against < 1033 AND golden_rivers = "nullawil" AND byes < 2 | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_in... | css |
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 Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation ORDER BY SUM(Enrollment) | nvbench |
CREATE TABLE table_18045 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Directed by" FROM table_18045 WHERE "Original air date" = 'January 15, 2008' | wikisql |
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE artist (
Ar... | SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result ORDER BY Result DESC | nvbench |
CREATE TABLE table_6651 (
"Year" text,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won in the men's doubles in 1980?
| SELECT "Men's doubles" FROM table_6651 WHERE "Year" = '1980' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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... | 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 = 2514)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperatur... | mimic_iii |
CREATE TABLE driverStandings (
driverStandingsId INTEGER,
raceId INTEGER,
driverId INTEGER,
points REAL,
position INTEGER,
positionText TEXT,
wins INTEGER
)
CREATE TABLE circuits (
circuitId INTEGER,
circuitRef TEXT,
name TEXT,
location TEXT,
country TEXT,
lat REAL,
... | SELECT year, COUNT(year) FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T1.driverId = T3.driverId WHERE T3.forename = "Lewis" GROUP BY year ORDER BY year | nvbench |
CREATE TABLE table_46046 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Grizzlies" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school was Chris Robinson from?
| SELECT "School/Club Team" FROM table_46046 WHERE "Player" = 'chris robinson' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit te... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =... | mimic_iii |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Give a me a bar graph to sh... | SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person) ORDER BY T1.name | nvbench |
CREATE TABLE table_name_44 (
lines VARCHAR,
stations VARCHAR,
rider_per_mile VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many lines have fewer than 44 stations and fewer than 881 riders per mile?
| SELECT COUNT(lines) FROM table_name_44 WHERE stations < 44 AND rider_per_mile < 881 | sql_create_context |
CREATE TABLE table_name_73 (
opponent VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent on week 2?
| SELECT opponent FROM table_name_73 WHERE week = 2 | sql_create_context |
CREATE TABLE table_23284 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 1994 is the first elected what is the district?
| SELECT "District" FROM table_23284 WHERE "First elected" = '1994' | wikisql |
CREATE TABLE table_4539 (
"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 was the venue when the home team scored 9.22... | SELECT "Venue" FROM table_4539 WHERE "Home team score" = '9.22 (76)' | wikisql |
CREATE TABLE table_20521 (
"Member State" text,
"Population in millions" text,
"Population % of EU" text,
"Area km 2" real,
"Area % of EU" text,
"Pop. density People/km 2" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the population densit... | SELECT COUNT("Pop. density People/km 2") FROM table_20521 WHERE "Population % of EU" = '1.7%' | wikisql |
CREATE TABLE table_77856 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Home team has a Venue of arden street oval... | SELECT "Home team" FROM table_77856 WHERE "Venue" = 'arden street oval' | wikisql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | SELECT Users.Id AS "user_link", COUNT(OwnerUserId) AS num FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE NOT CommunityOwnedDate IS NULL AND ClosedDate IS NULL AND NOT OwnerUserId IS NULL GROUP BY Users.Id ORDER BY num DESC | sede |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar... | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.departure_time > 718 AND flight.to_airport = AIRPORT_SERVICE_1.airport... | atis |
CREATE TABLE table_14603057_2 (
class_aAAA VARCHAR,
school_year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Class AAAA winners where in 2002-03?
| SELECT COUNT(class_aAAA) FROM table_14603057_2 WHERE school_year = "2002-03" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Gentamicin Sulfate" | mimicsql_data |
CREATE TABLE table_44622 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of spectators on week 4?
| SELECT COUNT("Attendance") FROM table_44622 WHERE "Week" = '4' | wikisql |
CREATE TABLE table_name_38 (
nickname VARCHAR,
location VARCHAR,
affiliation VARCHAR,
founded VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school has a public nickname, founded after 1838 in Harrisonburg, Va?
| SELECT nickname FROM table_name_38 WHERE affiliation = "public" AND founded > 1838 AND location = "harrisonburg, va" | sql_create_context |
CREATE TABLE table_name_66 (
tie_no VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Tie # has an Away team of slough town?
| SELECT tie_no FROM table_name_66 WHERE away_team = "slough town" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime) <= DATETIME(CURRENT_TIME(), '-4 year') | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.