context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_70597 (
"Poll source" text,
"Date(s) administered" text,
"Tom Campbell*" text,
"Meg Whitman" text,
"Steve Poizner" text,
"Peter Foy*" text
) | What poll had Steve Poizner at 37%? | SELECT "Poll source" FROM table_70597 WHERE "Steve Poizner" = '37%' | wikisql |
CREATE TABLE table_name_79 (
type VARCHAR,
cancelable VARCHAR,
attribute VARCHAR
) | Name the type with cancelable of no and attribute of ondragend | SELECT type FROM table_name_79 WHERE cancelable = "no" AND attribute = "ondragend" | sql_create_context |
CREATE TABLE table_14823 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What is the Date, when the Opponent is Gisela Dulko? | SELECT "Date" FROM table_14823 WHERE "Opponent" = 'gisela dulko' | wikisql |
CREATE TABLE table_66868 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Which rider had more than 23 laps, a manufacturer of Aprilia, and a grid of 14 | SELECT "Rider" FROM table_66868 WHERE "Laps" > '23' AND "Manufacturer" = 'aprilia' AND "Grid" = '14' | wikisql |
CREATE TABLE endowment (
endowment_id int,
School_id int,
donator_name text,
amount real
)
CREATE TABLE School (
School_id text,
School_name text,
Location text,
Mascot text,
Enrollment int,
IHSAA_Class text,
IHSAA_Football_Class text,
County text
)
CREATE TABLE budget ... | Compare the total enrollment in each county with a bar chart. | SELECT County, SUM(Enrollment) FROM School GROUP BY County | nvbench |
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... | How many dead patients were less than 41 years of age? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.age < "41" | mimicsql_data |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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,
JO... | For those employees who was hired before 2002-06-21, find hire_date and the average of manager_id bin hire_date by weekday, and visualize them by a bar chart, sort the average of manager id in asc order. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_name_7 (
score_in_the_final VARCHAR,
championship VARCHAR
) | What was the score of the French Open? | SELECT score_in_the_final FROM table_name_7 WHERE championship = "french open" | sql_create_context |
CREATE TABLE table_6251 (
"Year" real,
"Class" text,
"Team" text,
"Chassis" text,
"Tyre" text,
"Laps" real
) | What's the total of Year that's got a Team of Porsche Kremer Racing? | SELECT SUM("Year") FROM table_6251 WHERE "Team" = 'porsche kremer racing' | wikisql |
CREATE TABLE table_name_33 (
score VARCHAR,
game VARCHAR
) | What was the score of Game 48? | SELECT score FROM table_name_33 WHERE game = 48 | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id ... | Which class is easiest to fulfill the MDE requirement for me ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou... | advising |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | list all DAILY flights between OAKLAND and BOSTON using AA | 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 = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOST... | atis |
CREATE TABLE table_train_271 (
"id" int,
"renal_disease" bool,
"hepatic_disease" bool,
"smoking" bool,
"coronary_artery_disease_cad" bool,
"serum_creatinine" float,
"body_mass_index_bmi" float,
"myocardial_infarction" bool,
"NOUSE" float
) | body mass index > 30 kg / m2 | SELECT * FROM table_train_271 WHERE body_mass_index_bmi > 30 | criteria2sql |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
... | how many students are advised by each rank of faculty? List the rank and the number of students, order by the the total number from high to low. | SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 这家6526650的医疗机构给患者做蒲地蓝消炎口服液检查记录共有多少 | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '6526650' AND t_kc22.SOC_SRT_DIRE_NM = '蒲地蓝消炎口服液' | css |
CREATE TABLE table_204_729 (
id number,
"year" text,
"show" text,
"role" text,
"channel" text,
"notes" text
) | what was this actor 's first television role ? | SELECT "role" FROM table_204_729 ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | count the number of patients whose death status is 1 and days of hospital stay is greater than 14? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.days_stay > "14" | mimicsql_data |
CREATE TABLE table_25016824_2 (
vote VARCHAR,
air_date VARCHAR
) | What was the vote when the air date is 4 october 1997? | SELECT vote FROM table_25016824_2 WHERE air_date = "4 October 1997" | 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... | Average response time by tags. The average response time for most popular tags (with at least one vote) | SELECT COUNT(DISTINCT Id) AS responses, AVG(CAST((JULIANDAY(ClosedDate) - JULIANDAY(CreationDate)) * 24.0 AS INT)) AS average_response_time_in_hours FROM Posts WHERE CreationDate >= '2020-09-2' AND ClosedDate <= '2020-09-28' | sede |
CREATE TABLE table_37347 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What day is their record 13-15? | SELECT "Date" FROM table_37347 WHERE "Record" = '13-15' | wikisql |
CREATE TABLE table_26033 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
) | Who was the writer for the show titled 'and the rocky goes to...'? | SELECT "Written by" FROM table_26033 WHERE "Title" = 'And the Rocky Goes To...' | wikisql |
CREATE TABLE table_10023387_1 (
doubles_w_l VARCHAR,
years_played VARCHAR
) | what's the doubles w-l with years played value of 1 (1968) | SELECT doubles_w_l FROM table_10023387_1 WHERE years_played = "1 (1968)" | sql_create_context |
CREATE TABLE table_3763 (
"Artist" text,
"Country" text,
"Number-one single(s)" text,
"Year" real,
"Weeks at #1" real,
"Straight to #1 ?" text
) | Name the straight to number 1 for tribal king | SELECT "Straight to #1 ?" FROM table_3763 WHERE "Artist" = 'Tribal King' | 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,
... | how many patients marital status is divorced and diagnoses is pressure ulcer, stage i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.long_title = "Pressure ulcer, stage I" | mimicsql_data |
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
) | For those records from the products and each product's manufacturer, give me the comparison about the average of price over the founder , and group by attribute founder by a bar chart, rank in desc by the x-axis. | SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC | nvbench |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX ... | 这个患者00559880的身高和体重是多少? | SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz... | css |
CREATE TABLE table_41520 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text
) | Who was the 20 Questions section aimed at when Centerfold Model was Rachel Je n Marteen? | SELECT "20 Questions" FROM table_41520 WHERE "Centerfold model" = 'rachel jeán marteen' | wikisql |
CREATE TABLE table_57703 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What Grid has a Time/Retired of clutch? | SELECT SUM("Grid") FROM table_57703 WHERE "Time/Retired" = 'clutch' | wikisql |
CREATE TABLE table_name_58 (
score VARCHAR,
opponent VARCHAR
) | What was the score when Bornor Regis Town was the opponent? | SELECT score FROM table_name_58 WHERE opponent = "bornor regis town" | sql_create_context |
CREATE TABLE table_70082 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Pts." real
) | What is the oldest model Porsche v12 that has points less than or equal to 0. | SELECT MIN("Year") FROM table_70082 WHERE "Engine" = 'porsche v12' AND "Pts." < '0' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | get me the top four most frequent treatments since 2101? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE STRFTIME('%y', treatment.treatmenttime) >= '2101' GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE table_74392 (
"#" text,
"Title" text,
"Author" text,
"Doctor" text,
"Featuring companion" text,
"Published" text,
"ISBN" text,
"Audiobook narrator" text
) | What is the title of book number 7? | SELECT "Title" FROM table_74392 WHERE "#" = '7' | wikisql |
CREATE TABLE table_name_26 (
wins INTEGER,
matches VARCHAR,
year VARCHAR
) | What is the greatest Wins with Matches smaller than 5, and a Year of 1994? | SELECT MAX(wins) FROM table_name_26 WHERE matches < 5 AND year = 1994 | sql_create_context |
CREATE TABLE table_21164557_1 (
original_air_date VARCHAR,
production_code VARCHAR
) | How many original air dates were there for episodes with a production code of 4398016? | SELECT COUNT(original_air_date) FROM table_21164557_1 WHERE production_code = 4398016 | sql_create_context |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases IN... | How many wines with a price higher than 100 of each year? Show a bar chart that converts year into weekday interval. | SELECT Year, COUNT(Year) FROM wine WHERE Price > 100 | nvbench |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId ... | Questions Count for User Reputation Range. | SELECT COUNT(*) FROM (SELECT (d.Id) AS id FROM Posts AS d LEFT JOIN PostHistory AS ph ON ph.PostId = d.Id LEFT JOIN PostLinks AS pl ON pl.PostId = d.Id LEFT JOIN Posts AS o ON o.Id = pl.RelatedPostId LEFT JOIN Users AS u ON u.Id = d.OwnerUserId WHERE d.PostTypeId = 1 AND u.Reputation > 999 AND u.Reputation < 10000) AS ... | sede |
CREATE TABLE table_33800 (
"Medal" text,
"Name" text,
"Games" text,
"Sport" text,
"Event" text
) | Which event in the 2008 Beijing Games had a bronze medal? | SELECT "Event" FROM table_33800 WHERE "Games" = '2008 beijing' AND "Medal" = 'bronze' | wikisql |
CREATE TABLE table_204_332 (
id number,
"administrative\narea" text,
"area\nkm2" number,
"area\nsq mi" number,
"population" number,
"administrative\ncentre" text
) | what administrative area comes before nightingale island ? | SELECT "administrative\narea" FROM table_204_332 WHERE id = (SELECT id FROM table_204_332 WHERE "administrative\narea" = 'nightingale island') - 1 | squall |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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 te... | 根据检测指标结果定量单位的具体数值和检测指标名称与检验指标记录69156371520完全匹配的记录显示,哪些检测指标结果定量是大于等于69156371520检验指标记录的? | SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '69156371520') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '69156371520') AND jyjgzbb.JCZBJGDL >= (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '69156371520') | css |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,... | 患者陶国兴之前就诊的医院是哪个 | SELECT mzjzjlb.YLJGDM 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 = '陶国兴' UNION SELECT hz_info_zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzj... | css |
CREATE TABLE table_name_33 (
floors INTEGER,
rank VARCHAR,
building VARCHAR
) | What is the lowest amount of floors after rank 1 in the Trillium (residential) building? | SELECT MIN(floors) FROM table_name_33 WHERE rank > 1 AND building = "the trillium (residential)" | sql_create_context |
CREATE TABLE fgwyjzb (
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 gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '朱红叶' GROUP BY gwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '朱红叶' GROUP BY fgwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_81 (
week VARCHAR,
opponent VARCHAR,
attendance VARCHAR
) | What is the total number of Week, when Opponent is At Chicago Bears, and when Attendance is greater than 49,070? | SELECT COUNT(week) FROM table_name_81 WHERE opponent = "at chicago bears" AND attendance > 49 OFFSET 070 | sql_create_context |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | 看看这个门诊的中医诊断编码是什么?就是37329151718的哪个住院就诊 | SELECT wdmzjzjlb.MZZYZDZZBM FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '37329151718' UNION SELECT bdmzjzjlb.MZZYZDZZBM FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '37329151718' | css |
CREATE TABLE table_name_17 (
events INTEGER,
top_10 INTEGER
) | I want the average events for top 10 less than 4 | SELECT AVG(events) FROM table_name_17 WHERE top_10 < 4 | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,... | what was the name of the output the last time patient 51177 had since 08/01/2101? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid 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 = 51177)) AND STRFTIME('%y-%m-%d', outputeve... | mimic_iii |
CREATE TABLE table_21340 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | In the game resulting in a 5-11 record, who scored the high rebounds? | SELECT "High rebounds" FROM table_21340 WHERE "Record" = '5-11' | wikisql |
CREATE TABLE table_64565 (
"Name" text,
"Years" text,
"A-League" text,
"Finals" text,
"Total" text
) | What years have 10 (0) in the finals? | SELECT "Years" FROM table_64565 WHERE "Finals" = '10 (0)' | wikisql |
CREATE TABLE betfront (
year number,
datetime time,
country text,
competion text,
match text,
home_opening number,
draw_opening number,
away_opening number,
home_closing number,
draw_closing number,
away_closing number
)
CREATE TABLE football_data (
season text,
date... | What is the away team against Omiya Ardija in 2018? | SELECT awayteam FROM football_data WHERE hometeam = "Omiya Ardija" AND season LIKE "%2018%" | worldsoccerdatabase |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResults (
Id number,
... | Questions by hour of day. | SELECT TIME_TO_STR(CreationDate, '%h') * 60 + TIME_TO_STR(CreationDate, '%M') AS minute, SUM(CASE PostTypeId WHEN 1 THEN 1 ELSE 0 END) AS questions, SUM(CASE PostTypeId WHEN 2 THEN 1 ELSE 0 END) AS answers FROM Posts WHERE PostTypeId = 1 OR PostTypeId = 2 AND CreationDate >= '##mindate:string?20140101##' GROUP BY TIME_... | sede |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TA... | what flights are there on DL from BOSTON to DALLAS | 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 jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 患者08045413检验的脸部的各项指标结果怎么样? | SELECT * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_44492 (
"Archbishop" text,
"Born" text,
"Ordained Priest" text,
"Ordained Bishop" text,
"Appointed Archbishop" text,
"Vacated throne" text,
"Died" text
) | When was the archbishop that was born on February 10, 1858 ordained a bishop? | SELECT "Ordained Bishop" FROM table_44492 WHERE "Born" = 'february 10, 1858' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | tell me the date of patient 6940's birth? | SELECT patients.dob FROM patients WHERE patients.subject_id = 6940 | mimic_iii |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE cour... | List some courses worth 11 credits . | SELECT DISTINCT name, number FROM course WHERE credits = 11 AND department = 'EECS' | advising |
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,
... | how many male patients had the lab test for amylase? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "Amylase" | mimicsql_data |
CREATE TABLE table_65003 (
"World record" text,
"Snatch" text,
"Yang Lian ( CHN )" text,
"98kg" text,
"Santo Domingo , Dominican" text
) | What is the 98kg for Santo Domingo, Domincan on 1 October 2006? | SELECT "98kg" FROM table_65003 WHERE "Santo Domingo , Dominican" = '1 october 2006' | 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... | how many elective hospital admission patients are diagnosed with blood in stool? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Blood in stool" | mimicsql_data |
CREATE TABLE table_23385853_1 (
rally_base VARCHAR,
rally_name VARCHAR
) | Name the rally base for rallye de france alsace | SELECT rally_base FROM table_23385853_1 WHERE rally_name = "Rallye de France Alsace" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 医疗机构5267326超过27天的住院天数的人有多少? | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE zyjzjlb.YLJGDM = '5267326' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 27 | css |
CREATE TABLE table_name_10 (
seats_up_for_election INTEGER,
election_result VARCHAR,
new_council VARCHAR
) | How many seats were up for election during the vote where the election result was 9 and the new council 27? | SELECT SUM(seats_up_for_election) FROM table_name_10 WHERE election_result = 9 AND new_council > 27 | sql_create_context |
CREATE TABLE table_45237 (
"Name" text,
"Raw bandwidth (Mbit/s)" text,
"Max. cable length (m)" text,
"Power provided" text,
"Devices per channel" text
) | What is the Raw bandwidth (Mbit/s) for the SAS 300? | SELECT "Raw bandwidth (Mbit/s)" FROM table_45237 WHERE "Name" = 'sas 300' | wikisql |
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
gender VARCHAR(1),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Students (
student_id I... | For the sum of monthly_rental, date_address_to, visualize the trend. | SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses GROUP BY date_address_to ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_41307 (
"Ballarat FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the least amount of draws with an against of 1261? | SELECT MIN("Draws") FROM table_41307 WHERE "Against" = '1261' | wikisql |
CREATE TABLE institution (
TYPE VARCHAR,
enrollment INTEGER
) | Show institution types, along with the number of institutions and total enrollment for each type. | SELECT TYPE, COUNT(*), SUM(enrollment) FROM institution GROUP BY TYPE | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | 由门诊诊断为硅肺Ⅲ期的检测的三碘甲状腺原氨酸数值的平均值以及最值分别是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '矽肺(硅肺)Ⅲ期' AND jyjgzbb.JCZBMC = ... | css |
CREATE TABLE table_2409041_9 (
title VARCHAR,
written_by VARCHAR
) | What was the name of the epiode written by Gary M. Goodrich? | SELECT title FROM table_2409041_9 WHERE written_by = "Gary M. Goodrich" | sql_create_context |
CREATE TABLE table_36594 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text,
"Attendance" real
) | How many people attended the game on October 31? | SELECT "Attendance" FROM table_36594 WHERE "Date" = 'october 31' | 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... | what is minimum age of patients whose admission type is newborn and insurance is government? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.insurance = "Government" | mimicsql_data |
CREATE TABLE table_41417 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Points" real
) | What team was Paolo Quinteros on? | SELECT "Team" FROM table_41417 WHERE "Name" = 'paolo quinteros' | wikisql |
CREATE TABLE table_name_47 (
first_elected INTEGER,
result VARCHAR,
incumbent VARCHAR
) | What was the lowest re-elected result for Sylvester C. Smith? | SELECT MIN(first_elected) FROM table_name_47 WHERE result = "re-elected" AND incumbent = "sylvester c. smith" | sql_create_context |
CREATE TABLE table_17170 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) | What years for the rockets did player ford, alton alton ford play? | SELECT "Years for Rockets" FROM table_17170 WHERE "Player" = 'Ford, Alton Alton Ford' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arriv... | what are connecting flights from CHICAGO to SEATTLE on 6 1 | 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND date_day.day_number = 1 AND date_day.month_number = 6 AND d... | atis |
CREATE TABLE table_11960196_3 (
high_points VARCHAR,
game VARCHAR
) | Who did the high points of game 5? | SELECT high_points FROM table_11960196_3 WHERE game = 5 | sql_create_context |
CREATE TABLE table_5268 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | In what year is the notes distance 1.83m? | SELECT "Year" FROM table_5268 WHERE "Notes" = '1.83m' | wikisql |
CREATE TABLE table_40548 (
"Round" text,
"Opposition" text,
"First leg" text,
"Second leg" text,
"Aggregate score" text
) | Who has the first leg that has a round in the semi-final? | SELECT "First leg" FROM table_40548 WHERE "Round" = 'semi-final' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of phone_number and department_id in a bar chart, and I want to sort from high to low by the Y-axis. | SELECT PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC | nvbench |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 在0七年三月四日到一九年十二月三日这段时间内,医院2510888医治的住院病人共有多少 | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2510888' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-03-04' AND '2019-12-03' AND t_kc21.CLINIC_TYPE = '住院' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is the number of patients whose year of death is less than or equal to 2112 and drug name is voriconazole? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.drug = "Voriconazole" | mimicsql_data |
CREATE TABLE fgwyjzb (
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,
... | 在医疗诊断43267723179就诊期间其就诊的定点医疗机构编码是多少? | SELECT gwyjzb.FLX_MED_ORG_ID FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '43267723179' UNION SELECT fgwyjzb.FLX_MED_ORG_ID FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '43267723179' | css |
CREATE TABLE table_name_64 (
ihsaa_class VARCHAR,
year_joined VARCHAR,
mascot VARCHAR
) | Which ISHAA school joined in 2012 and has a mascot of the panthers? | SELECT ihsaa_class FROM table_name_64 WHERE year_joined < 2012 AND mascot = "panthers" | sql_create_context |
CREATE TABLE table_46216 (
"Date" text,
"Opponent" text,
"Location" text,
"Time" text,
"Result" text
) | Where did the Lightning play the NY Rangers at 7:00 pm? | SELECT "Location" FROM table_46216 WHERE "Opponent" = 'ny rangers' AND "Time" = '7:00 pm' | wikisql |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | what is the number of patients whose discharge location is home health care and procedure short title is tonsil&adenoid biopsy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Tonsil&adenoid biopsy" | mimicsql_data |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar... | In the Spring-Summer term are any PreMajor or MDE courses offered ? | SELECT DISTINCT course.department, course.name, course.number, program_course.category FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category IN ('PreMajor', 'MDE') AND program_course.course_id = course.course_id AND semester.semester = 'Spr... | advising |
CREATE TABLE table_name_2 (
name VARCHAR,
rocket VARCHAR,
block VARCHAR
) | What name has a Rocket of titan iv(401)b and a Block of block i/ii hybrid? | SELECT name FROM table_name_2 WHERE rocket = "titan iv(401)b" AND block = "block i/ii hybrid" | sql_create_context |
CREATE TABLE table_name_27 (
language VARCHAR,
director VARCHAR
) | What is the language of the film directed by Federico Fellini? | SELECT language FROM table_name_27 WHERE director = "federico fellini" | sql_create_context |
CREATE TABLE table_59105 (
"Child" text,
"Date of birth" text,
"Mother" text,
"Father" text,
"DNA testing status" text
) | Who is the father that was born on January 2, 1842? | SELECT "Father" FROM table_59105 WHERE "Date of birth" = 'january 2, 1842' | wikisql |
CREATE TABLE table_name_64 (
launched VARCHAR,
ship VARCHAR
) | What launch has a Ship of fearless? | SELECT launched FROM table_name_64 WHERE ship = "fearless" | sql_create_context |
CREATE TABLE table_49969 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" text
) | what is the place when the score is 68-72-77-74=291? | SELECT "Place" FROM table_49969 WHERE "Score" = '68-72-77-74=291' | wikisql |
CREATE TABLE table_name_41 (
tropical_lows INTEGER,
season VARCHAR,
tropical_cyclones VARCHAR
) | What is the least amount of tropical lows for the 1993 94 season with less than 11 tropical cyclones | SELECT MIN(tropical_lows) FROM table_name_41 WHERE season = "1993–94" AND tropical_cyclones < 11 | sql_create_context |
CREATE TABLE table_name_17 (
rally_name VARCHAR,
surface VARCHAR
) | Which Rally Name has a Surface of asphalt and gravel? | SELECT rally_name FROM table_name_17 WHERE surface = "asphalt and gravel" | sql_create_context |
CREATE TABLE table_58035 (
"Round" real,
"Player" text,
"Nationality" text,
"NHL Team" text,
"College/Junior/Club Team (League)" text
) | what is the nhl team for round 10? | SELECT "NHL Team" FROM table_58035 WHERE "Round" = '10' | wikisql |
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 admissions (
row_id number,
subject_id number,
hadm... | what were three of the most frequent intakes until 2 years ago? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 3) | mimic_iii |
CREATE TABLE table_name_6 (
nationality VARCHAR,
college_junior_club_team__league_ VARCHAR
) | What is the nationality of the player who played for the Peterborough Petes (OHL)? | SELECT nationality FROM table_name_6 WHERE college_junior_club_team__league_ = "peterborough petes (ohl)" | sql_create_context |
CREATE TABLE table_1601027_2 (
succeeded_by VARCHAR,
earpads VARCHAR
) | Name what succeeded by for foam | SELECT succeeded_by FROM table_1601027_2 WHERE earpads = "Foam" | sql_create_context |
CREATE TABLE table_name_51 (
ngc_number INTEGER,
declination___j2000__ VARCHAR
) | what is the highest ngc number when the declination (j2000) is 25 26 ? | SELECT MAX(ngc_number) FROM table_name_51 WHERE declination___j2000__ = "°25′26″" | sql_create_context |
CREATE TABLE table_13858 (
"Date" text,
"Label" text,
"Format" text,
"Country" text,
"Catalog" text
) | When was the release that was in SACD (hybrid) format? | SELECT "Date" FROM table_13858 WHERE "Format" = 'sacd (hybrid)' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text te... | Top Answerers for Tag: score = sum of scores with a cap score per answer. | SELECT P.OwnerUserId AS "user_link", SUM(CASE WHEN P.Score < @Cap THEN P.Score ELSE @Cap END) AS TotalScore, COUNT(*) AS "#Answers" FROM Posts AS P INNER JOIN PostTags AS PT ON PT.PostId = P.ParentId INNER JOIN Tags AS T ON T.Id = PT.TagId WHERE T.TagName = '##TagName##' AND NOT P.OwnerUserId IS NULL GROUP BY P.OwnerUs... | sede |
CREATE TABLE table_name_57 (
method VARCHAR,
time VARCHAR,
record VARCHAR
) | What is the method of resolution for the fight that had a time of 5:00 and a record of 5-0? | SELECT method FROM table_name_57 WHERE time = "5:00" AND record = "5-0" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Delet... | How many users on Stack. | SELECT COUNT(*) FROM Users | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.