instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_62876 (
"Team" text,
"Matches" real,
"Wins" real,
"Wins %" text,
"Draws" real,
"Draws %" text,
"Losses" real,
"Losses %" text,
"Against" real,
"For & Against Ratio" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT "Matches" FROM table_62876 WHERE "Draws %" = '50%' AND "Team" = 'milan' | wikisql |
CREATE TABLE table_55698 (
"D 41" text,
"D 42" text,
"D 43" text,
"D 44" text,
"D 45" text,
"D 46" text,
"D 47" text,
"R 53" text,
"R 52" text,
"R 51" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the D 47 for D 46 of r ... | SELECT "D 47" FROM table_55698 WHERE "D 46" = 'r 35' | wikisql |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "V5866" | mimicsql_data |
CREATE TABLE table_name_24 (
maximum_download_speed__kbps VARCHAR,
technology VARCHAR,
plan_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum download speed for the Internet basic plan with 3G?
| SELECT maximum_download_speed__kbps FROM table_name_24 WHERE technology = "3g" AND plan_name = "internet basic" | sql_create_context |
CREATE TABLE table_60578 (
"Year (Ceremony)" text,
"Original title" text,
"Film title used in nomination" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year has a not nominated result and a nomination title of '... | SELECT "Year (Ceremony)" FROM table_60578 WHERE "Result" = 'not nominated' AND "Film title used in nomination" = 'the color of fame' | wikisql |
CREATE TABLE table_name_81 (
date VARCHAR,
course VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date was a rest day?
| SELECT date FROM table_name_81 WHERE course = "rest day" | 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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '郑丹红' AND t_kc22.STA_DATE BETWEEN '2001-08-25' AND '2014-08-03' AND t_kc22.SELF_PAY_PRO < 0.85 | css |
CREATE TABLE table_31114 (
"Provider" text,
"Country" text,
"Subscribers (2005) (thousands)" real,
"Subscribers (2006) (thousands)" real,
"Growth %" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum number of 2006 subscribers for Mo... | SELECT MAX("Subscribers (2006) (thousands)") FROM table_31114 WHERE "Provider" = 'Mobilis' | wikisql |
CREATE TABLE table_40741 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team was the opponent on D... | SELECT "Team" FROM table_40741 WHERE "Date" = 'december 30' | wikisql |
CREATE TABLE table_79823 (
"Riding" text,
"Candidate's Name" text,
"Gender" text,
"Votes" real,
"Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of the candidate with more than 2,211 votes?
| SELECT "Rank" FROM table_79823 WHERE "Votes" > '2,211' | wikisql |
CREATE TABLE table_name_22 (
actor VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What actor won in 1978?
| SELECT actor FROM table_name_22 WHERE year = "1978" | sql_create_context |
CREATE TABLE table_name_45 (
race_name VARCHAR,
winning_driver VARCHAR,
constructor VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the race that featured stirling moss winning with a maserati at aintree?
| SELECT race_name FROM table_name_45 WHERE constructor = "maserati" AND circuit = "aintree" AND winning_driver = "stirling moss" | sql_create_context |
CREATE TABLE table_name_9 (
first_district VARCHAR,
fifth_district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who's the First District with a Fifth District of prudy adam?
| SELECT first_district FROM table_name_9 WHERE fifth_district = "prudy adam" | sql_create_context |
CREATE TABLE table_50391 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the match with a winner outcome an... | SELECT "Date" FROM table_50391 WHERE "Outcome" = 'winner' AND "Opponent in the final" = 'jim courier' | wikisql |
CREATE TABLE table_name_31 (
lane INTEGER,
notes VARCHAR,
time___sec__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lane for notes Q, SB and time less than 11.22?
| SELECT SUM(lane) FROM table_name_31 WHERE notes = "q, sb" AND time___sec__ < 11.22 | sql_create_context |
CREATE TABLE table_21469545_2 (
to_par VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the to par for 20 feb 2005
| SELECT to_par FROM table_21469545_2 WHERE date = "20 Feb 2005" | sql_create_context |
CREATE TABLE table_55166 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the away team where the hom... | SELECT "Away team score" FROM table_55166 WHERE "Home team score" = '14.8 (92)' | 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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
... | SELECT t2.drug 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 admissions.subject_id = 25696 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce... | mimic_iii |
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 COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '姜承运' AND t_kc22.STA_DATE BETWEEN '2008-03-30' AND '2021-02-01' AND t_kc22.SOC_SRT_DIRE_CD = '4940' | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-127262' AND NOT patient.hospitaldischargetime IS NULL ORDE... | eicu |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
... | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... | mimic_iii |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '29216620' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3853.34) | css |
CREATE TABLE table_name_30 (
pick VARCHAR,
name VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT PICK HAD STEVE HAMILTON IN ROUND LARGER THAN 2?
| SELECT COUNT(pick) FROM table_name_30 WHERE name = "steve hamilton" AND round > 2 | sql_create_context |
CREATE TABLE table_33423 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Stadium" text,
"Record" text,
"Box scores" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the game against ... | SELECT "Attendance" FROM table_33423 WHERE "Opponent" = 'pittsburgh steelers' | wikisql |
CREATE TABLE table_name_89 (
inversions INTEGER,
opened VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the sum of inversions for opened of april 20, 2002
| SELECT SUM(inversions) FROM table_name_89 WHERE opened = "april 20, 2002" | sql_create_context |
CREATE TABLE country (
country_id number,
country_name text,
capital text,
official_native_language text
)
CREATE TABLE match_season (
season number,
player text,
position text,
country number,
team number,
draft_pick_number number,
draft_class text,
college text
)
CREA... | SELECT college FROM match_season GROUP BY college HAVING COUNT(*) >= 2 | spider |
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.diagnosis = "PITUITARY BLEED" AND demographic.days_stay > "4" | mimicsql_data |
CREATE TABLE table_dev_9 (
"id" int,
"heart_disease" bool,
"hba1c" float,
"coronary_artery_disease_cad" bool,
"triglyceride_tg" float,
"hypertension" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- coronary artery disease or he... | SELECT * FROM table_dev_9 WHERE coronary_artery_disease_cad = 1 OR heart_disease = 1 | criteria2sql |
CREATE TABLE table_name_57 (
date VARCHAR,
winning_constructor VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Date of mercedes, and a Circuit of elgin?
| SELECT date FROM table_name_57 WHERE winning_constructor = "mercedes" AND circuit = "elgin" | 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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2165.0" AND procedures.icd9_code = "2219" | mimicsql_data |
CREATE TABLE table_name_29 (
year_s_ INTEGER,
games_drawn___tests__ VARCHAR,
points_against___tests__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest year when games drawn was 0, points against are 86?
| SELECT MIN(year_s_) FROM table_name_29 WHERE games_drawn___tests__ = "0" AND points_against___tests__ = "86" | sql_create_context |
CREATE TABLE table_203_854 (
id number,
"position" number,
"driver" text,
"no." text,
"car" text,
"entrant" text,
"rd 1" number,
"rd 2" number,
"rd 3" number,
"rd 4" number,
"rd 5" number,
"rd 6" number,
"rd 7" number,
"rd 8" number,
"total" number
)
-- Usin... | SELECT "driver" FROM table_203_854 WHERE "position" = 1 | squall |
CREATE TABLE body_builder (
Body_Builder_ID int,
People_ID int,
Snatch real,
Clean_Jerk real,
Total real
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Birth_Date text,
Birth_Place text
)
-- Using valid SQLite, answer the following questions fo... | SELECT People_ID, Clean_Jerk FROM body_builder | nvbench |
CREATE TABLE table_name_19 (
outgoing_manager VARCHAR,
date_of_vacancy VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the outgoing manager when the date of vacancy is 13 october 2008?
| SELECT outgoing_manager FROM table_name_19 WHERE date_of_vacancy = "13 october 2008" | sql_create_context |
CREATE TABLE table_name_22 (
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Dave Rummells's to par?
| SELECT to_par FROM table_name_22 WHERE player = "dave rummells" | sql_create_context |
CREATE TABLE drivers (
driverid number,
driverref text,
number number,
code text,
forename text,
surname text,
dob text,
nationality text,
url text
)
CREATE TABLE constructorresults (
constructorresultsid number,
raceid number,
constructorid number,
points number,
... | SELECT AVG(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year | spider |
CREATE TABLE table_47856 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest draft pick number for mark doak who had an overall pick smaller than ... | SELECT MIN("Pick") FROM table_47856 WHERE "Name" = 'mark doak' AND "Overall" < '147' | wikisql |
CREATE TABLE table_38361 (
"Season" text,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Season is listed for the Player of Jon Stefansson?
| SELECT "Season" FROM table_38361 WHERE "Player" = 'jon stefansson' | wikisql |
CREATE TABLE table_66337 (
"Restaurant Name" text,
"Original Name" text,
"Location" text,
"Chef" text,
"Designer" text,
"Still Open?" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the chef at Lakes Bar and Grill?
| SELECT "Chef" FROM table_66337 WHERE "Restaurant Name" = 'lakes bar and grill' | wikisql |
CREATE TABLE table_15306124_1 (
democratic_coalition INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the least amount of democratic colation
| SELECT MIN(democratic_coalition) FROM table_15306124_1 | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayNa... | SELECT T.TagName, T.WikiPostId AS Wiki, T.ExcerptPostId AS Excerpt, T.Count AS Questions, SEP.Comment AS "edit_comment", SEP.OwnerUserId AS "user_link" FROM Tags AS T INNER JOIN SuggestedEdits AS SEP ON SEP.PostId = T.WikiPostId INNER JOIN ReviewTasks AS RT ON RT.SuggestedEditId = SEP.PostId ORDER BY Questions DESC, SE... | sede |
CREATE TABLE table_77944 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the match on July 29, 1990?
| SELECT "Score" FROM table_77944 WHERE "Date" = 'july 29, 1990' | wikisql |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | (SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy... | css |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREA... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON... | atis |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "10" AND diagnoses.icd9_code = "76513" | mimicsql_data |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_zone (
time_zone_cod... | 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 = 'PITTSBURGH' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'PITTSBURGH' AND ground_servic... | atis |
CREATE TABLE table_39686 (
"County" text,
"Per capita income" text,
"Median household income" text,
"Median family income" text,
"Population" real,
"Number of households" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Median househol... | SELECT "Median household income" FROM table_39686 WHERE "Median family income" = '$46,616' | wikisql |
CREATE TABLE table_57340 (
"Rank" real,
"Name" text,
"Height m ( ft )" text,
"Floors" real,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the average year for rank more than 3 and 28 floors
| SELECT AVG("Year") FROM table_57340 WHERE "Rank" > '3' AND "Floors" = '28' | wikisql |
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 demographic ... | 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.long_title = "Family history of other specified malignant neoplasm" | mimicsql_data |
CREATE TABLE table_65487 (
"Year" real,
"Venue" text,
"Men's Open" text,
"Women's Open" text,
"Men's 35s" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue earlier than 1995 with Men's Open of QLD and Men's 35 of QLD and Woman's Open ... | SELECT "Venue" FROM table_65487 WHERE "Men's 35s" = 'qld' AND "Men's Open" = 'qld' AND "Year" < '1995' AND "Women's Open" = 'qld' | wikisql |
CREATE TABLE table_14342367_7 (
field_goals INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least amount of field goals made by a player?
| SELECT MIN(field_goals) FROM table_14342367_7 | sql_create_context |
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
)
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
)
-- Using valid SQLite, answer the follo... | SELECT COUNT(DISTINCT country) FROM climber | spider |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.dob_year > "2080" | mimicsql_data |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate tim... | SELECT Id AS "user_link", Reputation, WebsiteUrl, Location, AboutMe, LastAccessDate FROM Users WHERE UPPER(Location) LIKE '%Goa, India%' OR UPPER(Location) LIKE '%Goa%' OR UPPER(Location) LIKE '%India, Goa%' ORDER BY Reputation DESC | sede |
CREATE TABLE table_name_90 (
date VARCHAR,
opponent VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the opponent the White Sox and the record 18-13?
| SELECT date FROM table_name_90 WHERE opponent = "white sox" AND record = "18-13" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT COUNT(*) AS Volume, SUM(ViewCount) AS PageViews, COUNT(DISTINCT OwnerUserId) AS UniqueOPs, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE ('tags' LIKE '%<android%') AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY TIM... | sede |
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, AVG(SALARY) FROM employees ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE table_67037 (
"Year" real,
"Chassis" text,
"Engine(s)" text,
"Tyres" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What engine has 2 points?
| SELECT "Engine(s)" FROM table_67037 WHERE "Points" = '2' | wikisql |
CREATE TABLE table_16010376_1 (
muzzle_energy VARCHAR,
cartridge VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When using a .375 Winchester, what is the muzzle energy?
| SELECT muzzle_energy FROM table_16010376_1 WHERE cartridge = ".375 Winchester" | sql_create_context |
CREATE TABLE table_79481 (
"Frequency" text,
"Station" text,
"Operator" text,
"Language" text,
"Genre" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the genre of the BBC World Service?
| SELECT "Genre" FROM table_79481 WHERE "Station" = 'bbc world service' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time... | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13897) AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '2101-11' ORDER BY microbiologyevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE discipline_enrollments (
campus number,
discipline number,
year number,
undergraduate number,
graduate number
)
CREATE TABLE campuses (
id number,
campus text,
location text,
county text,
year number
)
CREATE TABLE faculty (
campus number,
year number,
... | SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = "San Jose State University" AND T2.year = 1996 | spider |
CREATE TABLE table_19188562_2 (
season VARCHAR,
us_viewers__in_millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What season finale date has 2.02 million u.s. Viewers?
| SELECT season AS finale FROM table_19188562_2 WHERE us_viewers__in_millions_ = "2.02" | sql_create_context |
CREATE TABLE Clients (
Client_ID INTEGER,
Address_ID INTEGER,
Customer_Email_Address VARCHAR(255),
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Performers_in_Bookings (
Order_ID INTEGER,
Performer_ID INTEGER
)
CREATE TABLE Products ... | SELECT City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town ORDER BY COUNT(*) | nvbench |
CREATE TABLE mzb (
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(qtb.PERSON_ID) FROM qtb WHERE qtb.MED_SER_ORG_NO = '8744702' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(gyb.PERSON_ID) FROM gyb WHERE gyb.MED_SER_ORG_NO = '8744702' AND gyb.REMOTE_SETTLE_FLG = '异地1' OR gyb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(zyb.PERSON_ID... | css |
CREATE TABLE table_26999 (
"Name of Village" text,
"Name in Syriac" text,
"Number of Believers" real,
"Number of Priests" real,
"Number of Churches" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least number of believers
| SELECT MIN("Number of Believers") FROM table_26999 | wikisql |
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, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC | nvbench |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '27763330' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2422.71) | css |
CREATE TABLE performance (
songid number,
bandmate number,
stageposition text
)
CREATE TABLE albums (
aid number,
title text,
year number,
label text,
type text
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
CREATE TABLE songs (
songid number,
... | SELECT type FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.lastname = "Heilo" AND T2.title = "Der Kapitan" | spider |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2103') AS t1) - (SELECT C... | eicu |
CREATE TABLE table_name_14 (
election VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2nd Party has a Election of 1857?
| SELECT 2 AS nd_party FROM table_name_14 WHERE election = "1857" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientuni... | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '016-5834' | eicu |
CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
... | SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id DESC | nvbench |
CREATE TABLE Projects (
Code Char(4),
Name Char(50),
Hours int
)
CREATE TABLE Scientists (
SSN int,
Name Char(30)
)
CREATE TABLE AssignedTo (
Scientist int,
Project char(4)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of the n... | SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name ORDER BY T2.Name DESC | nvbench |
CREATE TABLE table_64251 (
"Class" text,
"Railway number(s)" text,
"Quantity" real,
"Year(s) of manufacture" text,
"Axle arrangement ( UIC )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the class when the quantity is 4?
| SELECT "Class" FROM table_64251 WHERE "Quantity" = '4' | wikisql |
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End_Date DATE
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
... | SELECT T1.Claim_ID, COUNT(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_ID = T2.Claim_ID GROUP BY T1.Claim_ID | nvbench |
CREATE TABLE table_68610 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the chassis when the points were greater than 0 and the entrant was March Engineering?
| SELECT "Chassis" FROM table_68610 WHERE "Points" > '0' AND "Entrant" = 'march engineering' | wikisql |
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 Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Revenue) | nvbench |
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 WHERE demographic.admission_type = "ELECTIVE" AND demographic.days_stay > "10" | mimicsql_data |
CREATE TABLE bank (
bname VARCHAR,
no_of_customers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the branch name of the bank that has the most number of customers.
| SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_68388 (
"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.
-- What year(s) did Mike Weir win player of the year?
| SELECT "Year(s) won" FROM table_68388 WHERE "Player" = 'mike weir' | wikisql |
CREATE TABLE table_dev_12 (
"id" int,
"systolic_blood_pressure_sbp" int,
"creatinine_clearance_cl" float,
"allergy_to_glucagon" bool,
"platelet_count" float,
"diastolic_blood_pressure_dbp" int,
"insulin_requirement" float,
"adverse_reaction_to_glucagon" bool,
"NOUSE" float
)
-- Usi... | SELECT * FROM table_dev_12 WHERE creatinine_clearance_cl > 1.5 | criteria2sql |
CREATE TABLE table_65396 (
"Year" real,
"Movie (in Kannada )" text,
"Director" text,
"Cast" text,
"Music Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What movie had the music director G.K. Venkatesh and director Siddalingaiah?
| SELECT "Movie (in Kannada )" FROM table_65396 WHERE "Music Director" = 'g.k. venkatesh' AND "Director" = 'siddalingaiah' | wikisql |
CREATE TABLE table_45432 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Opponent is Atlanta Hawks?
| SELECT "Score" FROM table_45432 WHERE "Opponent" = 'atlanta hawks' | wikisql |
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 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 '2004-01-21' AND '2017-09-23' | css |
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 t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_ID = '27763330' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2422.71) | css |
CREATE TABLE table_23554 (
"#" text,
"Original title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text,
"Prod. code" text,
"Viewers" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 1.17 is the production code how many... | SELECT COUNT("Original airdate") FROM table_23554 WHERE "Prod. code" = '1.17' | wikisql |
CREATE TABLE table_3567 (
"Contestant" text,
"Place" real,
"Age" real,
"Country" text,
"Federal state" text,
"City" text,
"Height" text,
"Measurements (in cm)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who are the participants from ... | SELECT "Contestant" FROM table_3567 WHERE "City" = 'Hanover' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lactate') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CU... | mimic_iii |
CREATE TABLE table_28540539_2 (
version VARCHAR,
release VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the version of the 1.0.12 release?
| SELECT version FROM table_28540539_2 WHERE release = "1.0.12" | sql_create_context |
CREATE TABLE table_63909 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" real,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nationality of lane 4?
| SELECT "Nationality" FROM table_63909 WHERE "Lane" = '4' | wikisql |
CREATE TABLE table_78775 (
"Edition" text,
"Date" text,
"Winner" text,
"Country" text,
"Time ( h : m : s )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the nationality of the winner on December 8, 1968?
| SELECT "Country" FROM table_78775 WHERE "Date" = 'december 8, 1968' | wikisql |
CREATE TABLE table_name_17 (
grid INTEGER,
constructor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest grid with matra as constructor?
| SELECT MIN(grid) FROM table_name_17 WHERE constructor = "matra" | sql_create_context |
CREATE TABLE table_40883 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the IATA code for the airport with an ICAO code of HLLS?
| SELECT "IATA" FROM table_40883 WHERE "ICAO" = 'hlls' | wikisql |
CREATE TABLE table_name_40 (
points VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points after 1956?
| SELECT COUNT(points) FROM table_name_40 WHERE year > 1956 | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '秦芳华' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 6792.26) | css |
CREATE TABLE table_name_47 (
destination VARCHAR,
stopping_pattern VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Destination has a Stopping pattern of [2777] mciver station platforms?
| SELECT destination FROM table_name_47 WHERE stopping_pattern = "[2777] mciver station platforms" | sql_create_context |
CREATE TABLE table_23938357_7 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest 07-08 oi best value?
| SELECT MIN(07 AS _08_oi_best) FROM table_23938357_7 | sql_create_context |
CREATE TABLE table_29302711_13 (
country VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country does the player named Mark Cox play for?
| SELECT country FROM table_29302711_13 WHERE name = "Mark Cox" | sql_create_context |
CREATE TABLE table_9763 (
"Stage" real,
"Winner" text,
"General Classification" text,
"Points Classification" text,
"Mountains Classification" text,
"Metas Volantes Classification" text,
"Team Classification" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "Metas Volantes Classification" FROM table_9763 WHERE "Stage" = '4' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.