context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE shop (
shop_id number,
shop_name text,
location text,
open_date text,
open_year number
)
CREATE TABLE stock (
shop_id number,
device_id number,
quantity number
)
CREATE TABLE device (
device_id number,
device text,
carrier text,
package_version text,
ap... | Count the number of different software platforms. | SELECT COUNT(DISTINCT software_platform) FROM device | spider |
CREATE TABLE table_73 (
"County" text,
"Precincts" real,
"Lunsford" real,
"% Lunsford" text,
"McConnell" real,
"% McConnell" text,
"Total" text
) | If % mcconnell is 47.17% what is the total number of mcconnell ? | SELECT COUNT("McConnell") FROM table_73 WHERE "% McConnell" = '47.17%' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NA... | For those employees who did not have any job in the past, show me the trend about manager_id over hire_date with a line chart. | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE roller_coaster (
Status VARCHAR
) | List the status shared by more than two roller coaster. | SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2 | 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... | when did patient 80119 receive bicarbonate test the first time until 03/2105? | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80119) AND STRFTIME('%y-%m', labevents.charttime) <= '2105-03' ORDER BY ... | mimic_iii |
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... | what is the number of patients whose diagnoses short title is dmi renl nt st uncntrld? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "DMI renl nt st uncntrld" | mimicsql_data |
CREATE TABLE table_5642 (
"Gatchaman" text,
"Battle of the Planets" text,
"G-Force" text,
"Eagle Riders" text,
"OVA (Harmony Gold Dub)" text,
"Rank" text,
"Bird Uniform" text,
"Weapon" text,
"Mecha" text,
"Japanese voice actor" text,
"Voice actor (BOTP)" text,
"Voice acto... | Who is the Japanese voice actor of the Battle of the Planets of Keyop? | SELECT "Japanese voice actor" FROM table_5642 WHERE "Battle of the Planets" = 'keyop' | wikisql |
CREATE TABLE table_name_37 (
gdp_per_capita__us INTEGER,
area__km²_ VARCHAR,
state VARCHAR
) | Which GDP per capita (US$) (2004) is the highest one that has an Area (km ) larger than 148825.6, and a State of roraima? | SELECT MAX(gdp_per_capita__us) AS $___2004_ FROM table_name_37 WHERE area__km²_ > 148825.6 AND state = "roraima" | sql_create_context |
CREATE TABLE table_23274514_4 (
team VARCHAR,
record VARCHAR
) | What team did the Wizards play against when their record was 2-5? | SELECT team FROM table_23274514_4 WHERE record = "2-5" | sql_create_context |
CREATE TABLE table_30382 (
"\u2116" real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | What was the number of episodes whose production code is 7ABB21? | SELECT COUNT("#") FROM table_30382 WHERE "Production code" = '7ABB21' | wikisql |
CREATE TABLE table_16749 (
"Rnd" real,
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | who is the pole position for the rnd 3 | SELECT "Pole Position" FROM table_16749 WHERE "Rnd" = '3' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | how many patients this year have been diagnosed with drug overdose- general - with decreased mental status during the same month after receiving a ssri administration? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'ssri administration' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'star... | eicu |
CREATE TABLE table_6449 (
"Birth" text,
"Marriage" text,
"Became Duchess" text,
"Ceased to be Duchess" text,
"Death" text,
"Spouse" text
) | What is the Birth of the lady that has a Became Duchess on 18 august 1593 husband's accession? | SELECT "Birth" FROM table_6449 WHERE "Became Duchess" = '18 august 1593 husband''s accession' | wikisql |
CREATE TABLE table_name_30 (
record VARCHAR,
score VARCHAR
) | which Record has a Score of 1 4? | SELECT record FROM table_name_30 WHERE score = "1–4" | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | Tags by number of views. | SELECT t.TagName, SUM(p.ViewCount) AS Views, SUM(p.ViewCount) / COUNT(*) AS "avg_views" FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id WHERE t.Count > @TagThreshold GROUP BY t.TagName ORDER BY 'avg_views' DESC | sede |
CREATE TABLE table_train_203 (
"id" int,
"gender" string,
"perforation" bool,
"hemoglobin_a1c_hba1c" float,
"peptic_ulcer_disease" bool,
"serum_c_peptide" float,
"gastrointestinal_disease" bool,
"serum_creatinine" float,
"age" float,
"NOUSE" float
) | hba1c 6 _ 9 % | SELECT * FROM table_train_203 WHERE hemoglobin_a1c_hba1c >= 6 AND hemoglobin_a1c_hba1c <= 9 | criteria2sql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE cost (
costid num... | when did patient 031-17834 receive a microbiology test on the first hospital encounter for the last time? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-17834' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
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... | what is the percentile of 1.8 for a creatinine lab test given the same age as patient 021-79544 during the first hospital visit? | SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'creatinine' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '021-79544' AND NOT pa... | eicu |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE flight_fare ... | do you have one to DENVER from PHILADELPHIA | 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'D... | atis |
CREATE TABLE table_name_41 (
away_team VARCHAR
) | What was the away score for Carlton? | SELECT away_team AS score FROM table_name_41 WHERE away_team = "carlton" | sql_create_context |
CREATE TABLE party_events (
event_id number,
event_name text,
party_id number,
member_in_charge_id number
)
CREATE TABLE region (
region_id number,
region_name text,
date text,
label text,
format text,
catalogue text
)
CREATE TABLE party (
party_id number,
minister text... | What are the names of parties and their respective regions? | SELECT T1.party_name, T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id | spider |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | A bar chart shows the distribution of All_Games and School_ID , show in ascending by the bar. | SELECT All_Games, School_ID FROM basketball_match ORDER BY All_Games | nvbench |
CREATE TABLE store (
TYPE VARCHAR
) | Find all types of store and number of them. | SELECT TYPE, COUNT(*) FROM store GROUP BY TYPE | sql_create_context |
CREATE TABLE table_61041 (
"Year" real,
"Award" text,
"Category" text,
"Title of work" text,
"Result" text
) | What year was The Saber nominated for best action? | SELECT AVG("Year") FROM table_61041 WHERE "Title of work" = 'saber' AND "Category" = 'best action' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | vsetci ktori maju viac ako 50 postov. | SELECT Users.DisplayName, COUNT(Posts.OwnerUserId) AS PocPostov FROM Posts INNER JOIN Users ON Users.Id = Posts.OwnerUserId GROUP BY DisplayName HAVING COUNT(Posts.OwnerUserId) > 5000 | sede |
CREATE TABLE table_1231892_4 (
number_in_series INTEGER,
broadcast_order VARCHAR
) | What's the series number of the episode with a broadcast order s04 e07? | SELECT MAX(number_in_series) FROM table_1231892_4 WHERE broadcast_order = "S04 E07" | sql_create_context |
CREATE TABLE table_16907214_1 (
paperback VARCHAR,
title VARCHAR
) | What is the ISBN of 'Dead as a Doornail? | SELECT paperback FROM table_16907214_1 WHERE title = "Dead as a Doornail" | sql_create_context |
CREATE TABLE table_name_48 (
home_team VARCHAR,
away_team VARCHAR
) | What did the home team when they played Richmond? | SELECT home_team AS score FROM table_name_48 WHERE away_team = "richmond" | sql_create_context |
CREATE TABLE table_32739 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What home team played at the western oval? | SELECT "Home team" FROM table_32739 WHERE "Venue" = 'western oval' | wikisql |
CREATE TABLE table_18813 (
"Specification" text,
"Gender" text,
"Junior High School (12\u201315 yrs)" text,
"Senior High School (15\u201318 yrs)" text,
"University students and Adults (18yrs+)" text
) | What is the specification where senior high school is 25mm? | SELECT "Specification" FROM table_18813 WHERE "Senior High School (15\u201318 yrs)" = '25mm' | wikisql |
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... | 编号08963830388的医疗就诊开出的药品515167569的剂型和规格是什么 | SELECT t_kc22.DOSE_FORM, t_kc22.SPEC FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '08963830388' AND t_kc22.SOC_SRT_DIRE_CD = '515167569' | css |
CREATE TABLE table_65646 (
"Date Released" text,
"Polling institute" text,
"Social Democratic" text,
"Socialist" text,
"Green-Communist" text,
"Democratic and Social Centre" text,
"Lead" text
) | What's the green communist when Euroteste/JN is the polling Institute? | SELECT "Green-Communist" FROM table_65646 WHERE "Polling institute" = 'euroteste/jn' | wikisql |
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... | 从02年2月17日开始05年10月13日结束的医疗机构5215588的统筹总金额和总金额是多少元? | SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '5215588' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-02-17' AND '2005-10-13' | css |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
h... | give me the total amount of wound vac #1 that patient 92788 produces since 06/28/2104. | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92788)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'wou... | mimic_iii |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId num... | Top editors in a given period (excluding title/tag-only edits). | SELECT ph.UserId AS "user_link", COUNT(DISTINCT RevisionGUID) AS "count" FROM PostHistory AS ph WHERE ph.PostHistoryTypeId = 5 AND (ph.CreationDate >= '##Date1?2018-01-01##') AND (ph.CreationDate <= '##Date2?2018-12-31##') GROUP BY ph.UserId ORDER BY 'count' DESC LIMIT 100 | sede |
CREATE TABLE table_name_14 (
opponent VARCHAR,
date VARCHAR
) | What was the opponent on December 16, 1989? | SELECT opponent FROM table_name_14 WHERE date = "december 16, 1989" | sql_create_context |
CREATE TABLE table_1467951_4 (
release_date INTEGER
) | What is the most recent release date? | SELECT MAX(release_date) FROM table_1467951_4 | sql_create_context |
CREATE TABLE table_61315 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What was Fredrik Jacobson's score? | SELECT "Score" FROM table_61315 WHERE "Player" = 'fredrik jacobson' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | provide the number of patients whose days of hospital stay is greater than 43 and procedure short title is aortocor bypas-2 cor art? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "43" AND procedures.short_title = "Aortocor bypas-2 cor art" | mimicsql_data |
CREATE TABLE table_name_44 (
manufacturer VARCHAR,
laps VARCHAR,
time_retired VARCHAR
) | WHAT IS THE MANUFACTURER WITH 24 LAPS, AND +1.965 TIME/RETIRED? | SELECT manufacturer FROM table_name_44 WHERE laps = "24" AND time_retired = "+1.965" | sql_create_context |
CREATE TABLE table_name_95 (
session VARCHAR,
circuit VARCHAR
) | What was the session at the circuit of autodrom most? | SELECT session FROM table_name_95 WHERE circuit = "autodrom most" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row... | when was the last arterial bp [diastolic] of patient 25814 measured on this month/28? | SELECT chartevents.charttime 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 = 25814)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial... | mimic_iii |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text... | 通过门诊诊断出这个N08.618疾病人他们的籍贯代码、名称以及相应人数各是多少? | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND ... | css |
CREATE TABLE table_name_72 (
nation VARCHAR,
second VARCHAR
) | Which Nation has a Second of tomas pitonak? | SELECT nation FROM table_name_72 WHERE second = "tomas pitonak" | sql_create_context |
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... | 按照科室的名字不同、入院诊断的疾病编码不同看看医院5031026所有的就诊记录里患者平均是多大年纪 | SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5031026' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '50310... | css |
CREATE TABLE table_52088 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How big was the crowd in a game that had the home team score 18.19 (127)? | SELECT COUNT("Crowd") FROM table_52088 WHERE "Home team score" = '18.19 (127)' | wikisql |
CREATE TABLE table_57517 (
"Date of Issue" text,
"Theme" text,
"Design" text,
"Illustration" text,
"Paper Type" text,
"First Day Cover Cancellation" text
) | What is the Theme with a Paper Type of tullis russell coatings, and a Date with Issue of 1 october 2008? | SELECT "Theme" FROM table_57517 WHERE "Paper Type" = 'tullis russell coatings' AND "Date of Issue" = '1 october 2008' | wikisql |
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 prescriptions (
subject_id text,
hadm_id... | among patients who had a lab test of other fluid, how many of them were from white ethnic origin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE" AND lab.label = "RBC, Other Fluid" | mimicsql_data |
CREATE TABLE table_79213 (
"Actor" text,
"Character" text,
"Soap Opera" text,
"Years" text,
"Duration" text
) | How long did Joyce Jacobs portray her character on her show? | SELECT "Duration" FROM table_79213 WHERE "Actor" = 'joyce jacobs' | wikisql |
CREATE TABLE table_name_67 (
points INTEGER,
lost VARCHAR,
games VARCHAR
) | What is the sum of points values that are associated with 0 losses and more than 8 games? | SELECT SUM(points) FROM table_name_67 WHERE lost = 0 AND games > 8 | sql_create_context |
CREATE TABLE table_41542 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Which margin of victory has cyber agent ladies as the tournament? | SELECT "Margin of victory" FROM table_41542 WHERE "Tournament" = 'cyber agent ladies' | wikisql |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time 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_req... | i live in DENVER and i'd like to make a trip to PITTSBURGH | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU... | atis |
CREATE TABLE table_59382 (
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text,
"Week 6" text,
"Week 7" text
) | What is week 4 if week 3 is 35.40? | SELECT "Week 4" FROM table_59382 WHERE "Week 3" = '35.40' | wikisql |
CREATE TABLE table_70180 (
"Pick #" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What is the name of the player that is pick #69? | SELECT "Player" FROM table_70180 WHERE "Pick #" = '69' | wikisql |
CREATE TABLE table_58141 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | Who is the forward from Grambling State? | SELECT "Player" FROM table_58141 WHERE "Position" = 'forward' AND "School/Club Team" = 'grambling state' | wikisql |
CREATE TABLE table_204_985 (
id number,
"season" text,
"competition" text,
"round" text,
"club" text,
"home" text,
"away" text,
"aggregate" text
) | how many total seasons are given in the chart ? | SELECT COUNT("season") FROM table_204_985 | squall |
CREATE TABLE table_18291 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what's the party with candidates being silvio conte (r) unopposed | SELECT "Party" FROM table_18291 WHERE "Candidates" = 'Silvio Conte (R) Unopposed' | wikisql |
CREATE TABLE table_28250 (
"No." real,
"#" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original air date" text,
"Prod. code" real,
"U.S. viewers (million)" text
) | How many production codes are there for episode number 45? | SELECT COUNT("Prod. code") FROM table_28250 WHERE "No." = '45' | wikisql |
CREATE TABLE table_25114 (
"#" real,
"Name" text,
"Name (English)" text,
"Population 2008-07-01" real,
"Area (km\u00b2)" real,
"Pop./ km\u00b2" text,
"ISO 3166-2" text,
"Administrative centre" text
) | When the # is 4, what is the pop./ km ? | SELECT "Pop./ km\u00b2" FROM table_25114 WHERE "#" = '4' | wikisql |
CREATE TABLE table_name_47 (
genre VARCHAR,
country_of_origin VARCHAR,
artist VARCHAR
) | What was the genre of Queen (an artist from the United Kingdom)? | SELECT genre FROM table_name_47 WHERE country_of_origin = "united kingdom" AND artist = "queen" | sql_create_context |
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,
... | count the number of patients whose gender is f and discharge location is disch-tran to psych hosp? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" | mimicsql_data |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what are the four most commonly given lab tests since 2104 for patients who were previously diagnosed with lower gi bleeding - diverticular during the same month? | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'lower gi bleeding - diverticular' AND STRFTIME('%y',... | eicu |
CREATE TABLE table_9383 (
"Date" text,
"Opponent" text,
"Site" text,
"Result" text,
"Attendance" text
) | What is Site, when Opponent is 'All times are in eastern.'? | SELECT "Site" FROM table_9383 WHERE "Opponent" = 'all times are in eastern.' | wikisql |
CREATE TABLE Student (
Age VARCHAR,
Fname VARCHAR,
Lname VARCHAR
) | What is the age of student Linda Smith? | SELECT Age FROM Student WHERE Fname = "Linda" AND Lname = "Smith" | sql_create_context |
CREATE TABLE table_name_21 (
total INTEGER,
norrköping VARCHAR
) | What was the highest total when Norrkoping scored 12? | SELECT MAX(total) FROM table_name_21 WHERE norrköping = "12" | 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 jyjgzbb (
BGDH text,
BGRQ tim... | 患者28348727的检验结果指标均异常的检验报告单号是什么 | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '28348727' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTE... | What is the first and last name of the students who are not in the largest major?, order by the Y-axis from high to low. | SELECT Fname, COUNT(Fname) FROM Student WHERE Major <> (SELECT Major FROM Student) GROUP BY Fname ORDER BY COUNT(Fname) DESC | nvbench |
CREATE TABLE qtb (
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... | 找出从零四年十月二十五开始算,直到一八年的二月十八,这段时间里患者52950661在医院7572010开的所有药的名字和编码 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '52950661' AND qtb.MED_SER_ORG_NO = '7572010' AND qtb.IN_HOSP_DATE BETWEEN '2004-10-25' AND '2018-02-18' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = ... | css |
CREATE TABLE table_29236 (
"City" text,
"Population" real,
"Registered voters" text,
"Democratic" text,
"Republican" text,
"D\u2013R spread" text,
"Other" text,
"No party preference" text
) | What is the lowest population in which 28.0% are democrat? | SELECT MIN("Population") FROM table_29236 WHERE "Democratic" = '28.0%' | wikisql |
CREATE TABLE table_45201 (
"Name" text,
"Category" text,
"Eliminated" text,
"Date" text,
"Special Guest" text
) | Who was eliminated on Banana Night? | SELECT "Name" FROM table_45201 WHERE "Eliminated" = 'banana night' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | how many hours have passed since patient 022-6959 had an admission to the hospital? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '022-6959' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_28561455_1 (
no_in_series INTEGER,
written_by VARCHAR
) | What was the latest episode number that Meredith Averill wrote? | SELECT MAX(no_in_series) FROM table_28561455_1 WHERE written_by = "Meredith Averill" | sql_create_context |
CREATE TABLE table_54491 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | When the Attendance was 4,516, what was the Record? | SELECT "Record" FROM table_54491 WHERE "Attendance" = '4,516' | wikisql |
CREATE TABLE table_50040 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text,
"Points" real
) | Which Points have an Attendance of 21,273, and a Record of 5 1 1? | SELECT MIN("Points") FROM table_50040 WHERE "Attendance" = '21,273' AND "Record" = '5–1–1' | wikisql |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the sum of employee_id bin hire_date by time. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_name_42 (
stages VARCHAR,
year VARCHAR
) | Tell me the stages for 1981 | SELECT stages FROM table_name_42 WHERE year = 1981 | sql_create_context |
CREATE TABLE table_name_50 (
team_1 VARCHAR
) | What is the 2nd leg when Ermis Aradippou is the first team? | SELECT 2 AS nd_leg FROM table_name_50 WHERE team_1 = "ermis aradippou" | sql_create_context |
CREATE TABLE table_17048 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"MLB Draft" text
) | What school does Kerry Wood play for? | SELECT "School" FROM table_17048 WHERE "Player" = 'Kerry Wood' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE admissions... | how much does it cost patient 95892's hospital stay in the current hospital visit? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95892 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE T... | Show the number of the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000, could you display by the how many date of transaction in ascending? | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count > 100 OR amount_of_transaction > 1000 ORDER BY COUNT(date_of_transaction) | nvbench |
CREATE TABLE table_test_17 (
"id" int,
"anemia" bool,
"left_ventricular_ejection_fraction_lvef" int,
"systolic_blood_pressure_sbp" int,
"active_infection" bool,
"fever" bool,
"bradycardia" int,
"renal_disease" bool,
"oliguria" bool,
"creatinine_clearance_cl" float,
"left_vent... | systolic blood pressure < 100 mmhg | SELECT * FROM table_test_17 WHERE systolic_blood_pressure_sbp < 100 | criteria2sql |
CREATE TABLE table_name_59 (
year VARCHAR,
class VARCHAR,
stages_won VARCHAR
) | What year did he compete in the car class and win 0 stages? | SELECT year FROM table_name_59 WHERE class = "car" AND stages_won = "0" | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | when the last time patient 3712 was prescribed a medicine via oral route in the last hospital visit? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3712 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.route = 'oral' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
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... | 那个号码是29216620的病员使用过的药品均价不足3853.34元达到多些次?医疗就诊的编号是啥? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '29216620' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3853.34) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '29216620' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_... | css |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | Eric Lippert's comments about precedence. | SELECT * FROM Comments INNER JOIN Posts ON Comments.PostId = Posts.Id WHERE UserId = 88656 AND Body LIKE '%precedence%' ORDER BY Comments.CreationDate DESC | sede |
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 (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | when was the first time that patient 5544 had maximum phosphate value in 04/this year? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5544) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURREN... | mimic_iii |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar... | i would like to fly from ATLANTA to PHILADELPHIA | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILAD... | atis |
CREATE TABLE table_23285849_6 (
high_rebounds VARCHAR,
game VARCHAR
) | Who tied for highest rebounds in game 29? | SELECT high_rebounds FROM table_23285849_6 WHERE game = 29 | sql_create_context |
CREATE TABLE table_name_6 (
home_team VARCHAR,
date VARCHAR,
away_team VARCHAR
) | Playing against Chelmsford City on 15 November 1986, who was the home team? | SELECT home_team FROM table_name_6 WHERE date = "15 november 1986" AND away_team = "chelmsford city" | sql_create_context |
CREATE TABLE table_51301 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What's the average laps driven by david coulthard? | SELECT AVG("Laps") FROM table_51301 WHERE "Driver" = 'david coulthard' | wikisql |
CREATE TABLE table_name_14 (
nationality VARCHAR,
player VARCHAR
) | What Nationality is Jeff Hornacek? | SELECT nationality FROM table_name_14 WHERE player = "jeff hornacek" | sql_create_context |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE cours... | What 's the number of the course on Mentorship- Multidisciplinary Design ? | SELECT DISTINCT number FROM course WHERE (description LIKE '%Mentorship- Multidisciplinary Design%' OR name LIKE '%Mentorship- Multidisciplinary Design%') AND department = 'EECS' | advising |
CREATE TABLE table_4310 (
"Time Period" text,
"Position" text,
"Bureau" text,
"Office" text,
"District Attorney" text
) | Tell me the DA for bureau chief ada | SELECT "District Attorney" FROM table_4310 WHERE "Position" = 'bureau chief ada' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREA... | what is four of the most frequent intakes in 2102? | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2102' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE table_18450 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | In what district is the incumbent John Bell Williams? | SELECT "District" FROM table_18450 WHERE "Incumbent" = 'John Bell Williams' | wikisql |
CREATE TABLE table_name_16 (
event VARCHAR,
acts VARCHAR
) | I want to know the events for 106 bands | SELECT event FROM table_name_16 WHERE acts = "106 bands" | sql_create_context |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 从2012年10月17日到2017年12月25日之间名叫张静雅的患者就诊过多少个医生? | SELECT COUNT(DISTINCT 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 '2012-10-17' AND '2017-12-25' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is item id and lab test name of subject name chandra schulman? | SELECT lab.itemid, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Chandra Schulman" | mimicsql_data |
CREATE TABLE table_74000 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Name the total number of party for willis alston (j) 93.9% george e. spruill 6.1% | SELECT COUNT("Party") FROM table_74000 WHERE "Candidates" = 'Willis Alston (J) 93.9% George E. Spruill 6.1%' | wikisql |
CREATE TABLE table_name_31 (
notes VARCHAR,
position VARCHAR,
year VARCHAR
) | What is the notes distance for 2nd position earlier than 1986? | SELECT notes FROM table_name_31 WHERE position = "2nd" AND year < 1986 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.