instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_35084 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which College/Junior/Club Team (League) are from sweden?
| SELECT "College/Junior/Club Team (League)" FROM table_35084 WHERE "Nationality" = 'sweden' | wikisql |
CREATE TABLE table_42539 (
"Result" text,
"Opponent" text,
"Type" text,
"Round" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Type of ud and a Round of 10 on 2008-06-11?
| SELECT "Opponent" FROM table_42539 WHERE "Type" = 'ud' AND "Round" = '10' AND "Date" = '2008-06-11' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '2325366' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_D... | css |
CREATE TABLE table_43022 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of Wins in a PGA Championship with a ... | SELECT AVG("Wins") FROM table_43022 WHERE "Tournament" = 'pga championship' AND "Top-5" < '2' | wikisql |
CREATE TABLE table_43708 (
"Title" text,
"Russian" text,
"Transliteration" text,
"Original Text" text,
"Start" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Title has a Transliteration of u lyudey-to v domu?
| SELECT "Title" FROM table_43708 WHERE "Transliteration" = 'u lyudey-to v domu' | wikisql |
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'protein-calorie... | eicu |
CREATE TABLE table_name_47 (
best VARCHAR,
qual_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Best which has a Qual 2 of 58.700?
| SELECT best FROM table_name_47 WHERE qual_2 = "58.700" | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE diagnosis (
diagn... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'sedative - propofol' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-4 year')) | eicu |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_61264 (
"Military deaths" text,
"Civilian deaths" text,
"Total deaths (not including foreigners)" text,
"Military and/or Civilian wounded" text,
"Total casualties" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many civilians ... | SELECT "Civilian deaths" FROM table_61264 WHERE "Total casualties" = '1,130' | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND procedures.short_title = "Attach pedicle graft NEC" | mimicsql_data |
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_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
CREATE TABLE course (
crs_code text,
dept_co... | SELECT COUNT(*), T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code | spider |
CREATE TABLE table_57381 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number of laps were done by driver Ronnie Peterson?
| SELECT "Laps" FROM table_57381 WHERE "Driver" = 'ronnie peterson' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
Par... | SELECT * FROM PostHistoryTypes | sede |
CREATE TABLE table_train_237 (
"id" int,
"fasting_c_peptide" float,
"fasting_plasma_glucose" int,
"smoking" bool,
"body_mass_index_bmi" float,
"serum_25_oh_d_levels" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- serum 25 ( oh ... | SELECT * FROM table_train_237 WHERE serum_25_oh_d_levels < 20 | criteria2sql |
CREATE TABLE table_name_33 (
partner VARCHAR,
score_in_the_final VARCHAR,
date VARCHAR,
outcome VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the partner on a date later than 1971 who is the runner-up with a score of 3 6, 3 6?
| SELECT partner FROM table_name_33 WHERE date > 1971 AND outcome = "runner-up" AND score_in_the_final = "3–6, 3–6" | sql_create_context |
CREATE TABLE table_64690 (
"Team #1" text,
"Agg." text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is team number 1 when then 2nd leg is 64-97?
| SELECT "Team #1" FROM table_64690 WHERE "2nd leg" = '64-97' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,... | SELECT COUNT(*) FROM mzjzjlb WHERE JZKSBM = '54818' AND JZKSRQ BETWEEN '2012-03-10' AND '2017-03-23' | css |
CREATE TABLE table_59888 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the shooter when the rank points was 8 and the event was WC Kerrville?
| SELECT "Shooter" FROM table_59888 WHERE "Rank points" = '8' AND "Event" = 'wc kerrville' | 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 WHERE demographic.days_stay > "4" AND diagnoses.short_title = "Obs chr bronc w(ac) exac" | mimicsql_data |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "9" AND lab.label = "C4" | mimicsql_data |
CREATE TABLE table_70206 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Entrant older than 1950 has points smaller than 7?
| SELECT "Entrant" FROM table_70206 WHERE "Year" > '1950' AND "Points" < '7' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT COUNT(*) AS Total FROM Posts | sede |
CREATE TABLE table_76761 (
"Player" text,
"Pos." text,
"Nationality" text,
"Team" text,
"Previous team" text,
"Years of NBA experience [a ]" real,
"Career with the franchise [b ]" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the pla... | SELECT "Player" FROM table_76761 WHERE "Years of NBA experience [a ]" = '7' | wikisql |
CREATE TABLE table_77876 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the manner of departyre for 26 jan... | SELECT "Manner of departure" FROM table_77876 WHERE "Date of appointment" = '26 january' | wikisql |
CREATE TABLE table_name_78 (
position VARCHAR,
years_for_jazz VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did someone play from 1982-84?
| SELECT position FROM table_name_78 WHERE years_for_jazz = "1982-84" | sql_create_context |
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 JZJSSJ FROM mzjzjlb WHERE JZLSH = '88875856341' | css |
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 P.Id AS "post_link", P.Tags, P.Score, P.AnswerCount, P.CreationDate FROM Posts AS P, PostTags AS PT, Tags AS T WHERE P.Id = PT.PostId AND PT.TagId = T.Id AND T.TagName = 'julia' AND P.CreationDate > '2020-10-01' ORDER BY P.Score DESC, P.CreationDate DESC | sede |
CREATE TABLE table_name_98 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2006 has a 2007 of A?
| SELECT 2006 FROM table_name_98 WHERE 2007 = "a" | sql_create_context |
CREATE TABLE table_9704 (
"Year" real,
"Association" text,
"Category" text,
"Nominee" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result in a year before 2013 that the nomination category was Presenter Talent Show?
| SELECT "Result" FROM table_9704 WHERE "Year" < '2013' AND "Category" = 'presenter talent show' | wikisql |
CREATE TABLE user_profiles (
uid int(11),
name varchar(255),
email varchar(255),
partitionid int(11),
followers int(11)
)
CREATE TABLE follows (
f1 int(11),
f2 int(11)
)
CREATE TABLE tweets (
id bigint(20),
uid int(11),
text char(140),
createdate datetime
)
-- Using valid... | SELECT name, COUNT(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid | nvbench |
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 mzjzjlb.JZLSH 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 NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2019-02-14') | css |
CREATE TABLE table_21615 (
"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.
-- Name t... | SELECT "High assists" FROM table_21615 WHERE "Date" = 'April 8' | wikisql |
CREATE TABLE table_name_90 (
yards INTEGER,
player VARCHAR,
rec VARCHAR,
avg VARCHAR,
long VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Yards has an Avg larger than 7, and a Long smaller than 60, and a Rec larger than 19, and a Player of ... | SELECT AVG(yards) FROM table_name_90 WHERE avg > 7 AND long < 60 AND rec > 19 AND player = "correll buckhalter" | sql_create_context |
CREATE TABLE table_27905664_1 (
_number VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes were directed by Ken Fink?
| SELECT COUNT(_number) FROM table_27905664_1 WHERE directed_by = "Ken Fink" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 31088 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'mch cm... | mimic_iii |
CREATE TABLE table_13836704_7 (
freight___metric_tonnes__ VARCHAR,
transit_passengers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the total freights in metric tonnes when the total transit passengers is 147791?
| SELECT freight___metric_tonnes__ FROM table_13836704_7 WHERE transit_passengers = 147791 | sql_create_context |
CREATE TABLE table_46827 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the label in the region of Argentina and had a format of CD?
| SELECT "Label" FROM table_46827 WHERE "Format" = 'cd' AND "Region" = 'argentina' | wikisql |
CREATE TABLE table_50718 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the average total when bronze is more than 0, gold is 0, the nation is united states... | SELECT AVG("Total") FROM table_50718 WHERE "Bronze" > '0' AND "Gold" = '0' AND "Nation" = 'united states (usa)' AND "Silver" < '0' | wikisql |
CREATE TABLE table_21951 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sokn)" text,
"Church Name" text,
"Year Built" text,
"Location of the Church" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what parish is the Askrova Bedehuskapell church?
| SELECT "Parish (Prestegjeld)" FROM table_21951 WHERE "Church Name" = 'Askrova bedehuskapell' | wikisql |
CREATE TABLE table_203_676 (
id number,
"pick #" number,
"cfl team" text,
"player" text,
"position" text,
"college" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many players are an ol ?
| SELECT COUNT("cfl team") FROM table_203_676 WHERE "position" = 'ol' | squall |
CREATE TABLE table_203_836 (
id number,
"title" text,
"year" number,
"platforms" text,
"developer" text,
"publisher" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many games did spicy horse develop in total ?
| SELECT COUNT(*) FROM table_203_836 WHERE "developer" = 'spicy horse' | squall |
CREATE TABLE table_name_89 (
tournament VARCHAR,
winning_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Tournament has a Winning score of 16 (66-64-67=197)?
| SELECT tournament FROM table_name_89 WHERE winning_score = −16(66 - 64 - 67 = 197) | sql_create_context |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'CLLING' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spri... | advising |
CREATE TABLE table_name_18 (
podiums INTEGER,
class VARCHAR,
f_laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Podiums have a Class of 250cc, and an F laps of 0?
| SELECT SUM(podiums) FROM table_name_18 WHERE class = "250cc" AND f_laps = 0 | sql_create_context |
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 = jyjgzbb.YLJGDM AND jybgb.BGDH = jy... | css |
CREATE TABLE table_name_12 (
japanese_title VARCHAR,
episodes VARCHAR,
romaji_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Japanese Title has more than 9 Episodes, and a Romaji Title of haikei, chichiue-sama?
| SELECT japanese_title FROM table_name_12 WHERE episodes > 9 AND romaji_title = "haikei, chichiue-sama" | 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 zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT (SELECT COUNT(*) 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 = '36091672' AND mzjzjlb.JZKSRQ BETWEEN '2002-02-09' AND '2005-03-12') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_... | css |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '25470826' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2008-12-03' AND '2009-02-15' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fg... | css |
CREATE TABLE table_25911 (
"Episode" text,
"First broadcast" text,
"Seans team" text,
"Daves team" text,
"Scores" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the first broadcast date of the episode in which Sean's team is made up of Pete... | SELECT "First broadcast" FROM table_25911 WHERE "Seans team" = 'Peter Serafinowicz and Johnny Vegas' | wikisql |
CREATE TABLE table_70118 (
"Rank" real,
"Company" text,
"Revenues (US$ billion)" real,
"Profit (US$ billion)" real,
"Assets (US$ billion)" real,
"Market value (US$ billion)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which company has a mark... | SELECT "Company" FROM table_70118 WHERE "Market value (US$ billion)" > '1' AND "Assets (US$ billion)" < '10.7' AND "Rank" < '10' AND "Revenues (US$ billion)" = '9.3' | wikisql |
CREATE TABLE table_203_720 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which opponent scored the least amount of points against them in a game ?
| SELECT "opponent#" FROM table_203_720 ORDER BY "result" LIMIT 1 | squall |
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 T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter | nvbench |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalpe... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'insulin' AND STRFTIME('%y', treatment.treatm... | eicu |
CREATE TABLE Order_Items (
Order_Item_ID INTEGER,
Order_ID INTEGER,
Product_ID INTEGER,
Order_Quantity VARCHAR(288),
Other_Item_Details VARCHAR(255)
)
CREATE TABLE Customers (
Customer_ID VARCHAR(100),
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
... | SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code | nvbench |
CREATE TABLE table_26136 (
"Series episode" real,
"Season episode" real,
"Title" text,
"U.S. viewers (millions)" text,
"Original U.S. airdate" text,
"Prod. code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title when 1.121 millio... | SELECT "Title" FROM table_26136 WHERE "U.S. viewers (millions)" = '1.121' | wikisql |
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 * FROM t_kc21 WHERE MED_SER_ORG_NO = '4525816' AND IN_HOSP_DATE BETWEEN '2006-11-17' AND '2020-11-06') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '4525816' AND IN_HOSP_DATE BETWEEN '2006-11-17' AND '2020-11-06' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')) | css |
CREATE TABLE students (
student_id number,
date_of_registration time,
date_of_latest_logon time,
login_name text,
password text,
personal_name text,
middle_name text,
family_name text
)
CREATE TABLE courses (
course_id number,
author_id number,
subject_id number,
course_... | SELECT T1.course_name, COUNT(*) FROM courses AS T1 JOIN student_course_enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name | spider |
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 zyjzjlb.CYBQDM, zyjzjlb.CYBQMC, zyjzjlb.CYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '33793765856' | css |
CREATE TABLE table_165732_2 (
directed_by VARCHAR,
episode__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many directors did Episode #3 have
| SELECT COUNT(directed_by) FROM table_165732_2 WHERE episode__number = 3 | sql_create_context |
CREATE TABLE ARTIST (
Name VARCHAR,
ArtistId VARCHAR
)
CREATE TABLE ALBUM (
ArtistId VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which artist has the most albums?
| SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_47100 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Pick #, when Position is Guard, and when Round is greater than 2?
| SELECT SUM("Pick #") FROM table_47100 WHERE "Position" = 'guard' AND "Round" > '2' | wikisql |
CREATE TABLE table_dev_37 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"diabetes_mellitus" bool,
"dysglycemia" bool,
"creatinine_clearance_cl" float,
"estimated_glomerular_filtration_rate_egfr" int,
"fasting_plasma_glucose" int,
"serum_creatinine" float,
"fasting_gl... | SELECT * FROM table_dev_37 WHERE (serum_creatinine > 1.5 AND gender = 'male') OR (serum_creatinine > 1.4 AND gender = 'female') | criteria2sql |
CREATE TABLE table_76755 (
"Episode #" real,
"US air date" text,
"Rating" text,
"Share" text,
"Rating/Share (18\u201349)" text,
"Viewers (millions)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest numbered episode that had a ra... | SELECT MIN("Episode #") FROM table_76755 WHERE "Rating/Share (18\u201349)" = '0.9/4' AND "Viewers (millions)" > '3.79' | wikisql |
CREATE TABLE table_43255 (
"Season" text,
"Staffel A" text,
"Staffel B" text,
"Staffel C" text,
"Staffel D" text,
"Staffel E" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Staffel D in the season 1983-84 with a Staffel E of Motor Su... | SELECT "Staffel D" FROM table_43255 WHERE "Staffel E" = 'motor suhl' AND "Season" = '1983-84' | wikisql |
CREATE TABLE table_name_47 (
total VARCHAR,
play_offs INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many totals have a play-off less than 0?
| SELECT COUNT(total) FROM table_name_47 WHERE play_offs < 0 | sql_create_context |
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
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ... | mimic_iii |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airport_service (... | 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 ((flight.to_airport = AIRPORT_SERVICE_0.airport_code AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE') OR (flight.from_airpo... | atis |
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_middle_initial text,
customer_last_name text,
gender text,
email_address text,
login_name text,
login_password text,
phone_number text,
town_city text,
state_county_province text,
country text... | SELECT COUNT(*) FROM financial_transactions AS T1 JOIN accounts AS T2 ON T1.account_id = T2.account_id WHERE T2.account_name = "337" | spider |
CREATE TABLE table_74476 (
"Townland" text,
"Area( acres )" real,
"Barony" text,
"Civil parish" text,
"Poor law union" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the Poor Law Unions when the area (in acres) is 142?
| SELECT "Poor law union" FROM table_74476 WHERE "Area( acres )" = '142' | wikisql |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor | nvbench |
CREATE TABLE table_name_97 (
attendance INTEGER,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least attendance with carolina visitor
| SELECT MIN(attendance) FROM table_name_97 WHERE visitor = "carolina" | sql_create_context |
CREATE TABLE table_77951 (
"CERCLIS ID" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What construction completed on 08/... | SELECT "Listed" FROM table_77951 WHERE "Construction completed" = '08/10/2007' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7112 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mch') ORDER BY labevents.charttime DESC ... | mimic_iii |
CREATE TABLE table_name_83 (
lead VARCHAR,
third VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE LEAD WITH THIRD AS JEANNA SCHRAEDER?
| SELECT lead FROM table_name_83 WHERE third = "jeanna schraeder" | sql_create_context |
CREATE TABLE table_69259 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of medals won by nations that had 7 bronze medals and more than 18 gold medals?
| SELECT SUM("Total") FROM table_69259 WHERE "Bronze" = '7' AND "Gold" > '18' | wikisql |
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHAR(255)... | SELECT Statement_Details, COUNT(Statement_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details ORDER BY COUNT(Statement_Details) DESC | nvbench |
CREATE TABLE table_name_6 (
type VARCHAR,
source VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the type when the source is Realmadrid, and the name is Soldado?
| SELECT type FROM table_name_6 WHERE source = "realmadrid" AND name = "soldado" | sql_create_context |
CREATE TABLE table_name_53 (
country VARCHAR,
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Andy North with a To par greater than 8 Country?
| SELECT country FROM table_name_53 WHERE to_par > 8 AND player = "andy north" | sql_create_context |
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state ... | SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID | nvbench |
CREATE TABLE table_203_229 (
id number,
"pick #" number,
"nfl team" text,
"player" text,
"position" text,
"college" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was picked directly before ken riley ?
| SELECT "player" FROM table_203_229 WHERE "pick #" = (SELECT "pick #" FROM table_203_229 WHERE "player" = 'ken riley') - 1 | squall |
CREATE TABLE table_2384331_1 (
arena VARCHAR,
captain VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What arena does the team play at that has Michael Wales as the captain?
| SELECT arena FROM table_2384331_1 WHERE captain = "Michael Wales" | sql_create_context |
CREATE TABLE table_73739 (
"Year" real,
"Division" real,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the league for 2003
| SELECT "League" FROM table_73739 WHERE "Year" = '2003' | wikisql |
CREATE TABLE table_26267849_2 (
hometown VARCHAR,
age_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are all the hometown where the average age is 16
| SELECT hometown FROM table_26267849_2 WHERE age_s_ = "16" | sql_create_context |
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE volume (
Volume_ID int,
V... | SELECT Famous_Title, Age FROM artist ORDER BY Age DESC | nvbench |
CREATE TABLE table_43122 (
"Team" text,
"Country" text,
"Home" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the second of the North America team from Edmonton, Canada?
| SELECT "Second" FROM table_43122 WHERE "Team" = 'north america' AND "Country" = 'canada' AND "Home" = 'edmonton' | wikisql |
CREATE TABLE table_74244 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the episode 'adventures in... | SELECT "No. in season" FROM table_74244 WHERE "Title" = 'Adventures in Babysitting' | wikisql |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.short_title = "Abdominal wall incision" | mimicsql_data |
CREATE TABLE table_14329 (
"Rank" real,
"Year" real,
"Name" text,
"Moving from" text,
"Moving to" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was moved to barcelona?
| SELECT "Name" FROM table_14329 WHERE "Moving to" = 'barcelona' | wikisql |
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE reviewer (
rid number,
name text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT title FROM movie WHERE director = "James Cameron" OR year < 1980 | spider |
CREATE TABLE table_name_21 (
opponent VARCHAR,
points VARCHAR,
november VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which opponent has points less than 18, and a november greater than 11?
| SELECT opponent FROM table_name_21 WHERE points < 18 AND november > 11 | sql_create_context |
CREATE TABLE table_name_16 (
rank VARCHAR,
athlete VARCHAR,
react VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many total Rank listings have Liu Xiaosheng listed as the athlete with a react entry that is smaller than 0.245?
| SELECT COUNT(rank) FROM table_name_16 WHERE athlete = "liu xiaosheng" AND react < 0.245 | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT demographic.days_stay, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "76446" | mimicsql_data |
CREATE TABLE table_18449 (
"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.
-- What year were the latest elections?
| SELECT MAX("First elected") FROM table_18449 | wikisql |
CREATE TABLE table_27712451_6 (
high_rebounds VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many high rebounds took place on December 8?
| SELECT COUNT(high_rebounds) FROM table_27712451_6 WHERE date = "December 8" | sql_create_context |
CREATE TABLE playlist (
playlistid number,
name text
)
CREATE TABLE album (
albumid number,
title text,
artistid number
)
CREATE TABLE playlisttrack (
playlistid number,
trackid number
)
CREATE TABLE genre (
genreid number,
name text
)
CREATE TABLE invoice (
invoiceid number,... | SELECT T1.lastname FROM customer AS T1 JOIN employee AS T2 ON T1.supportrepid = T2.employeeid GROUP BY T1.supportrepid HAVING COUNT(*) <= 20 | spider |
CREATE TABLE table_name_72 (
track VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which track does the Woodward Stakes race take place on?
| SELECT track FROM table_name_72 WHERE race = "woodward stakes" | sql_create_context |
CREATE TABLE table_10932739_2 (
orbital_period VARCHAR,
semimajor_axis___au__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long is the orbital period for the planet that has a semimajor axis of 5.20 au?
| SELECT orbital_period FROM table_10932739_2 WHERE semimajor_axis___au__ = "5.20" | 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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '袁英武' AND t_kc22.STA_DATE BETWEEN '2003-07-04' AND '2010-02-19' AND t_kc22.SELF_PAY_PRO < 0.03 | css |
CREATE TABLE table_name_71 (
top_25 INTEGER,
top_5 VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Top-25 has a Top-5 larger than 9, and Wins smaller than 11?
| SELECT SUM(top_25) FROM table_name_71 WHERE top_5 > 9 AND wins < 11 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.