context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_2331 (
"School" text,
"Location(s)" text,
"Control" text,
"Type" text,
"Enrollment (2005)" text,
"Founded" real
) | What is the latest founding date? | SELECT MAX("Founded") FROM table_2331 | wikisql |
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 allergy (
allergy... | what was the last diagnostic time of pneumonia - community-acquired of patient 017-49375 since 2105? | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-49375')) AND diagnosis.diagnosisname = 'pneumonia - community... | eicu |
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 do not work in departments with managers that have ids between 100 and 200, show me about the distribution of phone_number and salary in a bar chart. | SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
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... | Positive scored questions without answers for c++ tags. | SELECT Id AS "Post Link", * FROM Posts WHERE AnswerCount = 0 AND Tags LIKE '%c++%' AND Score > 0 AND ClosedDate IS NULL ORDER BY Score DESC | sede |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 把患者08802995在零四年五月二十日到一六年七月八日内被开出药品486015771的总次数统计一下 | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '08802995' AND t_kc22.STA_DATE BETWEEN '2004-05-20' AND '2016-07-08' AND t_kc22.SOC_SRT_DIRE_CD = '486015771' | css |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
... | Posts with minimum answercount,score. | SELECT CAST((JULIANDAY(ClosedDate) - JULIANDAY(CreationDate)) * 86400.0 AS INT) AS Total_Time, Tags, Title, FavoriteCount, AnswerCount, Score, CommentCount, Posts.Id FROM Posts, PostTypes WHERE NOT ClosedDate IS NULL AND Posts.PostTypeId = PostTypes.Id AND PostTypes.Name = 'Question' ORDER BY Total_Time LIMIT 10 | sede |
CREATE TABLE table_name_15 (
venue VARCHAR,
year VARCHAR
) | What is the venue with a competition in 1964? | SELECT venue FROM table_name_15 WHERE year = 1964 | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses... | what are the three most frequently given diagnoses until 1 year ago for patients who were previously diagnosed with fluid overload nec within the same month? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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... | mimic_iii |
CREATE TABLE gas_station (
station_id number,
open_year number,
location text,
manager_name text,
vice_manager_name text,
representative_name text
)
CREATE TABLE company (
company_id number,
rank number,
company text,
headquarters text,
main_industry text,
sales_billion ... | What are the headquarters without companies that are in the banking industry? | SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking' | spider |
CREATE TABLE table_name_66 (
against VARCHAR,
draw VARCHAR,
losses VARCHAR,
matches VARCHAR
) | What is the total number of Against, when Losses is less than 52, when Matches is greater than 4, and when Draw is less than 2? | SELECT COUNT(against) FROM table_name_66 WHERE losses < 52 AND matches > 4 AND draw < 2 | sql_create_context |
CREATE TABLE table_204_190 (
id number,
"rank" number,
"city" text,
"county" text,
"state" text,
"percentage" text
) | number of cities in new jersey where the korean population is greater than 15 % | SELECT COUNT("city") FROM table_204_190 WHERE "state" = 'new jersey' AND "percentage" > 15 | squall |
CREATE TABLE certificate (
eid number,
aid number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
CREATE TABLE employee (
eid number,
name text,
salary number
)
... | What is the id and name of the employee with the highest salary? | SELECT eid, name FROM employee ORDER BY salary DESC LIMIT 1 | spider |
CREATE TABLE table_name_56 (
captain VARCHAR,
team VARCHAR
) | Who was the team captain for Crystal Palace? | SELECT captain FROM table_name_56 WHERE team = "crystal palace" | sql_create_context |
CREATE TABLE table_67482 (
"Name" text,
"Discovered" real,
"Museum" text,
"Museum city" text,
"Discoverer" text,
"Formation" text,
"Location" text
) | What is the city of the Museum that houses the specimen discovered by Jane Solem? | SELECT "Museum city" FROM table_67482 WHERE "Discoverer" = 'jane solem' | wikisql |
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_Home and School_ID , and group by attribute ACC_Home. | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home | nvbench |
CREATE TABLE appellations (
no number,
appelation text,
county text,
state text,
area text,
isava text
)
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,... | Give the distinct names of wines made before 2000 or after 2010. | SELECT DISTINCT name FROM wine WHERE year < 2000 OR year > 2010 | spider |
CREATE TABLE table_38614 (
"Home (1st leg)" text,
"Home (2nd leg)" text,
"1st Leg" text,
"2nd leg" text,
"Aggregate" text
) | What was the home team for the 2nd leg for the match having a 1st leg score of 2-1? | SELECT "Home (2nd leg)" FROM table_38614 WHERE "1st Leg" = '2-1' | wikisql |
CREATE TABLE table_17730 (
"Program" text,
"Degree" text,
"Focus" text,
"Teaching language" text,
"Duration (years)" text,
"full-time/part-time" text,
"ECTS Credit Points" real
) | What is the program where the focus is general management? | SELECT "Program" FROM table_17730 WHERE "Focus" = 'General Management' | wikisql |
CREATE TABLE table_204_480 (
id number,
"title" text,
"alternate title(s)" text,
"year" number,
"manufacturer" text,
"genre(s)" text,
"max. players" number
) | what is the genre of the last title on this chart ? | SELECT "genre(s)" FROM table_204_480 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_204_281 (
id number,
"map or catalog" text,
"creator" text,
"time created" text,
"contets" text,
"links" text
) | what is the name of the oldest map/catalog ? | SELECT "map or catalog" FROM table_204_281 ORDER BY id LIMIT 1 | squall |
CREATE TABLE table_1368649_9 (
spokesperson VARCHAR,
year_s_ VARCHAR
) | Who was the spokesperson for France in 1970? | SELECT spokesperson FROM table_1368649_9 WHERE year_s_ = 1970 | sql_create_context |
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... | 谷维素片在00年三月二十八日到一三年六月二十三日这段时间总用量是多少,这些用量有多少金额 | SELECT SUM(QTY), SUM(AMOUNT) FROM t_kc22 WHERE SOC_SRT_DIRE_NM = '谷维素片' AND STA_DATE BETWEEN '2000-03-28' AND '2013-06-23' | css |
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... | 能知道医疗机构8227829金额排在前二十四名的项目吗 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '8227829' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 24 | css |
CREATE TABLE table_27838 (
"Settlement" text,
"Cyrillic Name" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | In what settlement is the population 1114? | SELECT "Settlement" FROM table_27838 WHERE "Population (2011)" = '1114' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses... | during the previous year, what was the five most common medications prescribed to male patients 20s during the same month after they had been diagnosed with dmii wo cmp nt st uncntr? | 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 table_name_76 (
notes VARCHAR,
theme VARCHAR
) | What are the notes of the patience theme? | SELECT notes FROM table_name_76 WHERE theme = "patience" | 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,
... | what is the number of patients whose diagnoses icd9 code is 9951? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "9951" | mimicsql_data |
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... | give me the number of patients whose death status is 0 and procedure short title is arterial catheterization? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Arterial catheterization" | mimicsql_data |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | how many patients this year were staying in the ward 29? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 29 AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) | mimic_iii |
CREATE TABLE table_25330991_3 (
james_e_holmes VARCHAR,
western_rockingham_middle_school VARCHAR
) | Name the james e. holmes for duane hensley | SELECT james_e_holmes FROM table_25330991_3 WHERE western_rockingham_middle_school = "Duane Hensley" | sql_create_context |
CREATE TABLE table_name_73 (
stage INTEGER,
category VARCHAR,
year VARCHAR
) | What is the sum of the stages for category 1 races after the year 2003? | SELECT SUM(stage) FROM table_name_73 WHERE category = "1" AND year > 2003 | sql_create_context |
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 short title of diagnosis is hx-ven thrombosis/embols and stayed in hospital for more than 7 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "7" AND diagnoses.short_title = "Hx-ven thrombosis/embols" | mimicsql_data |
CREATE TABLE table_69057 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | On September 7 what was the record? | SELECT "Record" FROM table_69057 WHERE "Date" = 'september 7' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 潘乐山这位患者的补体C3在2003年5月12日到2009年10月10日期间的情况 | SELECT * 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 = jyjgzbb.BGDH WHERE hz_info.person_i... | css |
CREATE TABLE table_67248 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | Who was the home team on January 8? | SELECT "Home" FROM table_67248 WHERE "Date" = 'january 8' | wikisql |
CREATE TABLE table_201_31 (
id number,
"number" number,
"author" text,
"first line" text,
"notes" text
) | which author had a poem on this list with the first line as it fell upon day and also a poem that starts with if music and sweet poetry agree . | SELECT "author" FROM table_201_31 WHERE "first line" = '"as it fell upon a day"' | squall |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
... | Is there another person besides Prof. Etzion that teaches Leading Non-Profit Organizations ? | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Leading Non-Profit Organizations%' AND NOT instructor.name LIKE '%Etzion%' AND offering_instructor.instru... | advising |
CREATE TABLE table_18295 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many candidates won the election in the district whose incumbent is Bud Shuster? | SELECT COUNT("Candidates") FROM table_18295 WHERE "Incumbent" = 'Bud Shuster' | wikisql |
CREATE TABLE table_23427 (
"Shirt No" real,
"Nationality" text,
"Player" text,
"Birth Date" text,
"Height" real,
"Position" text
) | When was Alexey Kuleshov born? | SELECT "Birth Date" FROM table_23427 WHERE "Player" = 'Alexey Kuleshov' | wikisql |
CREATE TABLE table_14308895_2 (
last_competed INTEGER,
country_territory VARCHAR
) | when did new zealand last compete? | SELECT MAX(last_competed) FROM table_14308895_2 WHERE country_territory = "New Zealand" | sql_create_context |
CREATE TABLE table_29135051_2 (
guest_s_ VARCHAR,
ratings VARCHAR
) | Name the guest for 1.64m ratings | SELECT guest_s_ FROM table_29135051_2 WHERE ratings = "1.64m" | sql_create_context |
CREATE TABLE table_203_591 (
id number,
"high school" text,
"join\nyear" text,
"from" text,
"left" text,
"league left to" text
) | which high school left the same year as fenton high school ? | SELECT "high school" FROM table_203_591 WHERE "high school" <> 'fenton' AND "left" = (SELECT "left" FROM table_203_591 WHERE "high school" = 'fenton') | squall |
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date ... | Show all ministers who do not belong to Progress Party, and count them by a bar chart, and could you show total number from high to low order? | SELECT Minister, COUNT(Minister) FROM party WHERE Party_name <> 'Progress Party' GROUP BY Minister ORDER BY COUNT(Minister) DESC | nvbench |
CREATE TABLE table_30278 (
"Series no." real,
"Season no." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | What season number was assigned to the episode identified with the production code 401? | SELECT "Season no." FROM table_30278 WHERE "Production code" = '401' | wikisql |
CREATE TABLE table_26013618_1 (
nsg_nr VARCHAR,
date_established VARCHAR
) | How many reserves were established on 19740329 29.03.1974? | SELECT COUNT(nsg_nr) FROM table_26013618_1 WHERE date_established = "19740329 29.03.1974" | sql_create_context |
CREATE TABLE table_55146 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What's the catalog number for a record from columbia formatted in a cd/dvd that's from the United States region? | SELECT "Catalog" FROM table_55146 WHERE "Label" = 'columbia' AND "Region" = 'united states' AND "Format" = 'cd/dvd' | 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 the number of patients whose drug code is ris1l and lab test fluid is pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "RIS1L" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_name_5 (
brazil_scorers VARCHAR,
date VARCHAR,
result VARCHAR,
competition VARCHAR
) | Which Brazil scorers have a Result of w, and a Competition of world cup qualifying, and a Date of february 28, 1954? | SELECT brazil_scorers FROM table_name_5 WHERE result = "w" AND competition = "world cup qualifying" AND date = "february 28, 1954" | sql_create_context |
CREATE TABLE table_16216 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | How many weeks are there? | SELECT MAX("Week") FROM table_16216 | wikisql |
CREATE TABLE table_name_21 (
elevator VARCHAR,
elector VARCHAR
) | Who was the Elevator of Giacomo Colonna? | SELECT elevator FROM table_name_21 WHERE elector = "giacomo colonna" | 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... | 在零九年九月二十号直到一六年十月三十号之中患者李雅蕊被开出药品255778471-s总数是多少? | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '李雅蕊' AND t_kc22.STA_DATE BETWEEN '2009-09-20' AND '2016-10-30' AND t_kc22.SOC_SRT_DIRE_CD = '255778471-s' | css |
CREATE TABLE table_61487 (
"Clubs" text,
"Seasons at this level" text,
"Settlements" text,
"Season joined league" text,
"Position in 1959\u20131960" text
) | What was the position in 1959-1960 for the Sporting De Braga club? | SELECT "Position in 1959\u20131960" FROM table_61487 WHERE "Clubs" = 'sporting de braga' | wikisql |
CREATE TABLE Images (
image_id INTEGER,
image_alt_text VARCHAR(80),
image_name VARCHAR(40),
image_url VARCHAR(255)
)
CREATE TABLE Functional_Areas (
functional_area_code VARCHAR(15),
parent_functional_area_code VARCHAR(15),
functional_area_description VARCHAR(80)
)
CREATE TABLE Documents (... | What are the different role codes for users, and how many users have each Show bar chart, and rank in desc by the bars. | SELECT role_code, COUNT(*) FROM Users GROUP BY role_code ORDER BY role_code DESC | nvbench |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
Acce... | Search for symbols in question body. | SELECT p.Score, p.Id AS "post_link" FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'sh' AND p.Body LIKE '%${@%' | sede |
CREATE TABLE code_description (
code varchar,
description text
)
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,
fligh... | give me morning flights from CHARLOTTE to BALTIMORE | 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 = 'CHARLOTTE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BAL... | atis |
CREATE TABLE table_65747 (
"Sunrayia FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the wins when there are 5 losses, and against is more than 1205? | SELECT MAX("Wins") FROM table_65747 WHERE "Losses" = '5' AND "Against" > '1205' | wikisql |
CREATE TABLE table_name_77 (
crowd VARCHAR,
venue VARCHAR
) | What is the crowd total for glenferrie oval? | SELECT COUNT(crowd) FROM table_name_77 WHERE venue = "glenferrie oval" | sql_create_context |
CREATE TABLE table_77090 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Nets points" real,
"Opponents" real,
"Record" text,
"Streak" text
) | which opponent is from February 12? | SELECT "Opponent" FROM table_77090 WHERE "Date" = 'february 12' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
I... | Search my own answer posts.... This query returns the linked list of your answers partially matching the entered body text. Search is not case sensitive. The UserID parameter is your user ID (by default prefilled with your user ID) and the PostText is the text which you want to search for. | SELECT Id AS "post_link", Score AS "score", CreationDate AS "creation_date" FROM Posts WHERE OwnerUserId = @MyUserID AND PostTypeId IN (2, 3) ORDER BY CreationDate DESC | sede |
CREATE TABLE table_26527 (
"Episode" real,
"Contest" text,
"Original airdate" text,
"Challengers (Female)" text,
"Challengers (Male)" text,
"Events" text
) | Which female challengers featured in episode 28? | SELECT "Challengers (Female)" FROM table_26527 WHERE "Episode" = '28' | wikisql |
CREATE TABLE table_5222 (
"Variant id" text,
"5\u2019UTR splice" text,
"Coding" text,
"3\u2019UTR sequence" text,
"GenBank id" text
) | Which 3 UTR sequence has the GenBank ID at hq021440? | SELECT "3\u2019UTR sequence" FROM table_5222 WHERE "GenBank id" = 'hq021440' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is the number of patients admitted in hospital before 2180 who had albumin, pleural lab test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2180" AND lab.label = "Albumin, Pleural" | mimicsql_data |
CREATE TABLE table_20032301_3 (
poll_source VARCHAR,
dates_administered VARCHAR
) | What poll source administered their poll on June 14-16, 2010? | SELECT poll_source FROM table_20032301_3 WHERE dates_administered = "June 14-16, 2010" | sql_create_context |
CREATE TABLE table_name_23 (
nation VARCHAR,
event VARCHAR
) | What nation did the speed skater that set a record in the 1000 metres event represent? | SELECT nation FROM table_name_23 WHERE event = "1000 metres" | sql_create_context |
CREATE TABLE table_name_98 (
report VARCHAR,
location VARCHAR
) | What was the report in Buenos Aires? | SELECT report FROM table_name_98 WHERE location = "buenos aires" | sql_create_context |
CREATE TABLE table_23432 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | How many millions of people in the US watched the episode with season number 8? | SELECT "U.S. viewers (millions)" FROM table_23432 WHERE "No. in season" = '8' | wikisql |
CREATE TABLE table_name_9 (
runs__balls_ VARCHAR,
wicket VARCHAR,
opponent VARCHAR
) | Name the runs balls for wicket of 3rd for australia opponent | SELECT runs__balls_ FROM table_name_9 WHERE wicket = "3rd" AND opponent = "australia" | sql_create_context |
CREATE TABLE table_25340 (
"County" text,
"Population" real,
"Unemployment Rate" text,
"Market Income Per Capita" text,
"Poverty Rate" text,
"Status" text
) | what is the unemployment rate where the market income per capita is $16,406? | SELECT "Unemployment Rate" FROM table_25340 WHERE "Market Income Per Capita" = '$16,406' | wikisql |
CREATE TABLE table_46790 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | How many tries against have a losing bonus of 9? | SELECT "Tries against" FROM table_46790 WHERE "Losing bonus" = '9' | 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... | how many patients on main drug stayed for more than 2 days at hospital? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "2" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_24413 (
"Satellite" text,
"Launch date (UTC)" text,
"Decay" text,
"Mass(kg)" text,
"Diameter(m)" text,
"NSSDC ID" text,
"Nation" text,
"Usage" text
) | What is the nssdc id for Echo 1? | SELECT "NSSDC ID" FROM table_24413 WHERE "Satellite" = 'Echo 1' | wikisql |
CREATE TABLE table_1522 (
"Engine" text,
"Exhaust Ports" text,
"Bypass Ports" real,
"Bypass Boosters" text,
"SPI" text,
"Tapered Grind" text,
"Number on cyl." text
) | How many bypass boosters are there on the engine with slit exhaust ports and SPI is yes? | SELECT "Bypass Boosters" FROM table_1522 WHERE "SPI" = 'Yes' AND "Exhaust Ports" = 'Slit' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | find user by partial name match. | SELECT DisplayName AS "user_link", Reputation FROM Users WHERE DisplayName LIKE 'not%' ORDER BY Reputation DESC | sede |
CREATE TABLE table_78768 (
"Year" real,
"Competition" text,
"Awards" text,
"Category" text,
"Result" text
) | What year has Stacy as the category and award of Best Reality Star in Social Media? | SELECT MIN("Year") FROM table_78768 WHERE "Category" = 'stacy' AND "Awards" = 'best reality star in social media' | wikisql |
CREATE TABLE table_51388 (
"Name" text,
"Bodyweight" real,
"Snatch" real,
"Clean & jerk" real,
"Total (kg)" real
) | What was the average clean and jerk of all weightlifters who had a bodyweight smaller than 87.5 and a snatch of less than 95? | SELECT AVG("Clean & jerk") FROM table_51388 WHERE "Bodyweight" = '87.5' AND "Snatch" < '95' | wikisql |
CREATE TABLE table_66748 (
"Season" text,
"Champion" text,
"Runner Up" text,
"Israel Bowl" text,
"Venue" text,
"Date" text,
"Finals MVP" text
) | Name the Israel Bowl for march 30, 2012 | SELECT "Israel Bowl" FROM table_66748 WHERE "Date" = 'march 30, 2012' | wikisql |
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
)
... | what is the number of patients whose diagnoses long title is intervertebral disc disorder with myelopathy, unspecified region and drug name is succinylcholine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Intervertebral disc disorder with myelopathy, unspecified region" AND prescriptions.drug = ... | mimicsql_data |
CREATE TABLE table_15517 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What is the average round of the match with a draw result and a record of 4-4-1? | SELECT AVG("Round") FROM table_15517 WHERE "Res." = 'draw' AND "Record" = '4-4-1' | wikisql |
CREATE TABLE table_39070 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | On what date was the game at Lincoln Financial Field? | SELECT "Date" FROM table_39070 WHERE "Game site" = 'lincoln financial field' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE TagSynonyms (
Id number... | Posts By User Where Parent Tags Like. Posts by a user with a parent post that has a tag containing a word | SELECT d.Id AS "post_link", a.Body, b.Tags, c.ViewCount FROM Posts AS a INNER JOIN Posts AS d ON a.ParentId = d.Id INNER JOIN Posts AS b ON a.ParentId = b.Id INNER JOIN Posts AS c ON a.ParentId = c.Id WHERE a.OwnerUserId = @UserID AND b.Tags LIKE '%##TagContains##%' ORDER BY c.ViewCount DESC | sede |
CREATE TABLE table_44992 (
"Tournament" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"Career SR" text,
"Career Win-Loss" text
) | What is the 1994 finish for the Miami tournament? | SELECT "1994" FROM table_44992 WHERE "Tournament" = 'miami' | 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 d_labitems (
row_id number,
itemid number,
label te... | last time, what drug was prescribed for patient 88659 in 10/last year? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88659) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', prescriptions.startdate) = '10' ORD... | mimic_iii |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | count the number of patients whose marital status is single and drug route is inhalation? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "SINGLE" AND prescriptions.route = "INHALATION" | mimicsql_data |
CREATE TABLE table_52347 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | On April 29, with a game larger than 2, what is the high points? | SELECT "High points" FROM table_52347 WHERE "Game" > '2' AND "Date" = 'april 29' | wikisql |
CREATE TABLE table_name_43 (
score VARCHAR,
date VARCHAR
) | What was the score of the game played on May 9? | SELECT score FROM table_name_43 WHERE date = "may 9" | sql_create_context |
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,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 检查结果指标记载53877134131的参考值范围是多少、其下限与上限的具体值是多少? | SELECT CKZFWDX, CKZFWXX, CKZFWSX FROM jyjgzbb WHERE JYZBLSH = '53877134131' | css |
CREATE TABLE performance (
Performance_ID real,
Date text,
Host text,
Location text,
Attendance int
)
CREATE TABLE member (
Member_ID text,
Name text,
Nationality text,
Role text
)
CREATE TABLE member_attendance (
Member_ID int,
Performance_ID int,
Num_of_Pieces int
) | Compare the total number of locations in each location using a bar graph, rank from high to low by the y axis please. | SELECT Location, COUNT(Location) FROM performance GROUP BY Location ORDER BY COUNT(Location) DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients whose admission type is emergency and procedure icd9 code is 403? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "403" | mimicsql_data |
CREATE TABLE table_16109 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | What is the playoffs for the usl pro select league? | SELECT "Playoffs" FROM table_16109 WHERE "League" = 'USL Pro Select League' | wikisql |
CREATE TABLE table_name_82 (
solo VARCHAR,
total_tackles VARCHAR
) | what is solo when total tackles is 6? | SELECT solo FROM table_name_82 WHERE total_tackles = "6" | sql_create_context |
CREATE TABLE table_74145 (
"Date" text,
"Player" text,
"Injury" text,
"Date of injury" text,
"Number of matches (Total)" text,
"Source" text
) | What is the date of injury when the injury is foot injury and the number of matches (total) is 1? | SELECT "Date of injury" FROM table_74145 WHERE "Injury" = 'Foot injury' AND "Number of matches (Total)" = '1' | wikisql |
CREATE TABLE table_40434 (
"Band" text,
"Value" text,
"Ratio" text,
"Ratio as %" text,
"Average" text
) | Which Average has a Band of f? | SELECT "Average" FROM table_40434 WHERE "Band" = 'f' | wikisql |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate tim... | select users from Moldova, Romania with specific reputation and tags. | SELECT u.Id, u.DisplayName, u.Reputation, u.Location, u.WebsiteUrl, u.ProfileImageUrl, SUM(p.AnswerCount) AS "answers", p.Tags FROM Users AS u FULL OUTER JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE (u.Location LIKE ('%' + @Location + '%') OR u.Location LIKE ('%Romania%')) AND u.Reputation > 223 AND p.AnswerCount > 0 ... | sede |
CREATE TABLE table_name_34 (
winner VARCHAR,
year VARCHAR
) | What is Winner, when Year is 2001? | SELECT winner FROM table_name_34 WHERE year = 2001 | sql_create_context |
CREATE TABLE Staff (
staff_id INTEGER,
staff_gender VARCHAR(1),
staff_name VARCHAR(80)
)
CREATE TABLE Staff_Department_Assignments (
staff_id INTEGER,
department_id INTEGER,
date_assigned_from DATETIME,
job_title_code VARCHAR(10),
date_assigned_to DATETIME
)
CREATE TABLE Products (
... | What are the staff ids and genders of all staffs whose job title is Department Manager. Plot them as scatter chart. | SELECT T1.staff_id, T1.staff_gender FROM Staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = "Department Manager" | nvbench |
CREATE TABLE table_10125 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What was the attendance at the game when the record was 35-46? | SELECT "Attendance" FROM table_10125 WHERE "Record" = '35-46' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number... | Evolution of the number of new users. Number of new users per days. | SELECT DATE(STR(YEAR(CreationDate)) + '-' + STR(MONTH(CreationDate)) + '-' + STR(DAY(CreationDate))) AS FullDate, COUNT(*) AS Total FROM Users GROUP BY STR(YEAR(CreationDate)) + '-' + STR(MONTH(CreationDate)) + '-' + STR(DAY(CreationDate)) ORDER BY FullDate DESC | sede |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Descr... | Highest scoring questions and answers in Java/JavaScript tags. | SELECT TagName, QuestionID AS "post_link", q_.Score AS "q_score", AnswerID AS "post_link", a_.Score AS "a_score" FROM (SELECT TagName, (SELECT q.Id FROM Posts AS q INNER JOIN PostTags AS qt ON q.Id = qt.PostId WHERE qt.TagId = t.Id ORDER BY q.Score DESC LIMIT 1) AS QuestionID, (SELECT a.Id FROM Posts AS a INNER JOIN Po... | sede |
CREATE TABLE table_name_1 (
total INTEGER,
bronze VARCHAR,
gold VARCHAR
) | what is the total when bronze is more than 1 and gold smaller than 1? | SELECT SUM(total) FROM table_name_1 WHERE bronze > 1 AND gold < 1 | sql_create_context |
CREATE TABLE table_name_6 (
country VARCHAR,
name VARCHAR
) | Which country has Spence in the name section? | SELECT country FROM table_name_6 WHERE name = "spence" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.