context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | give me the number of patients whose primary disease is complete heart block and admission year is less than 2144? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.admityear < "2144" | mimicsql_data |
CREATE TABLE table_711 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many results have the two candidates Gene Taylor (r) 67.0% Ken Young (d) 33.0%? | SELECT COUNT("Result") FROM table_711 WHERE "Candidates" = 'Gene Taylor (R) 67.0% Ken Young (D) 33.0%' | wikisql |
CREATE TABLE table_20415 (
"Episode Number" real,
"Air Date" text,
"Guest Host" text,
"Musical Guest (Song performed)" text,
"Who knows the most about the guest host? panelists" text
) | Name the number of panelists for 20 january 2006 air date | SELECT COUNT("Who knows the most about the guest host? panelists") FROM table_20415 WHERE "Air Date" = '20 January 2006' | wikisql |
CREATE TABLE parking_fines (
council_tax_id number,
cmi_cross_ref_id number
)
CREATE TABLE benefits_overpayments (
council_tax_id number,
cmi_cross_ref_id number
)
CREATE TABLE council_tax (
council_tax_id number,
cmi_cross_ref_id number
)
CREATE TABLE customer_master_index (
master_custo... | How many different source system code for the cmi cross references are there? | SELECT COUNT(DISTINCT source_system_code) FROM cmi_cross_references | spider |
CREATE TABLE table_name_55 (
tournament VARCHAR
) | What shows for 2007 at the Olympic Games as tournament. | SELECT 2007 FROM table_name_55 WHERE tournament = "olympic games" | sql_create_context |
CREATE TABLE Locations (
Location_ID INTEGER,
Location_Name VARCHAR(255),
Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Photos (
Photo_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Name VARCHAR(255),
Description VARCHAR(255),
Filename VARCHAR(255),
Other_Details V... | A bar chart for what are the number of the distinct visit dates? | SELECT Visit_Date, COUNT(Visit_Date) FROM Visits | nvbench |
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 whose discharge location is short term hospital and lab test name is potassium, whole blood? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND lab.label = "Potassium, Whole Blood" | mimicsql_data |
CREATE TABLE book (
Book_ID int,
Title text,
Issues real,
Writer text
)
CREATE TABLE publication (
Publication_ID int,
Book_ID int,
Publisher text,
Publication_Date text,
Price real
) | Show different publishers together with the number of publications they have. | SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher | nvbench |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Na... | ELT Informatica Oracle in Moscow. | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id = p.Own... | sede |
CREATE TABLE table_24327 (
"Season" real,
"Episode" real,
"Episode Summary" text,
"Premier date" text,
"External Link" text,
"Coach" text
) | What is the episode summary for episode 5? | SELECT "Episode Summary" FROM table_24327 WHERE "Episode" = '5' | wikisql |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
... | How many courses for each teacher? Show me a stacked bar chart The x-axis is teacher's first name and group by course description, show in descending by the bars. | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION, EMP_FNAME ORDER BY EMP_FNAME DESC | nvbench |
CREATE TABLE table_name_20 (
high_assists VARCHAR,
location_attendance VARCHAR
) | Who has the high assists when location attendance is 20,562? | SELECT high_assists FROM table_name_20 WHERE location_attendance = "20,562" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code te... | retrieve patient ids of patients who are diagnosed with cong esoph fistula/atres since 2105. | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cong esoph fistula/atres') AND STRFTIME('%y', diagnoses_icd.charttime) >= ... | mimic_iii |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | give me the number of patients whose primary disease is hyperglycemia and days of hospital stay is greater than 14? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND demographic.days_stay > "14" | mimicsql_data |
CREATE TABLE table_name_11 (
year VARCHAR,
rank VARCHAR,
out_of VARCHAR
) | Tell me the year for rank more than 35 and out of 167 | SELECT year FROM table_name_11 WHERE rank > 35 AND out_of = 167 | sql_create_context |
CREATE TABLE table_name_64 (
surname VARCHAR,
dob VARCHAR,
throws VARCHAR,
position VARCHAR
) | Which Surname has Throws of r, and a Position of p, and a DOB of 26 april 1989? | SELECT surname FROM table_name_64 WHERE throws = "r" AND position = "p" AND dob = "26 april 1989" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text,
person_info_CSD text,
person_info_CSRQ time,
person_info_GJDM text,
person_info_GJMC text,
person_info_JGDM text,
person_info_JGMC text,
person_info_MZDM text,
person_info_MZMC text,
person_info_XBDM ... | 列出在医院0779082中患者郑家美名称包含注意的门诊诊断有什么门诊就诊记录? | SELECT * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '郑家美' AND hz_info.YLJGDM = '0779082' AND mzjzjlb.JZZDSM LIKE '%注意%' | css |
CREATE TABLE table_19897294_11 (
no_in_season VARCHAR,
no_in_series VARCHAR
) | What episode in the season was episode us17 in the series? | SELECT COUNT(no_in_season) FROM table_19897294_11 WHERE no_in_series = "US17" | sql_create_context |
CREATE TABLE table_204_624 (
id number,
"school" text,
"team name" text,
"town" text,
"county" text,
"enrollment (2010-11 & 2011-12)" number,
"primary mshsaa class*" number,
"football class" number
) | which school has the largest enrollment ? | SELECT "school" FROM table_204_624 ORDER BY "enrollment (2010-11 & 2011-12)" DESC LIMIT 1 | squall |
CREATE TABLE table_name_53 (
established INTEGER,
championships VARCHAR,
club VARCHAR
) | Name the average established for championships less than 1 and club of erie seawolves | SELECT AVG(established) FROM table_name_53 WHERE championships < 1 AND club = "erie seawolves" | sql_create_context |
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... | Closed, no answers and no activity for a week. | SELECT q.Id AS "post_link" FROM Posts AS q WHERE ClosedDate < CURRENT_TIMESTAMP() - '##deadline##' AND NOT EXISTS(SELECT 1 FROM PostHistory AS h WHERE h.CreationDate > CURRENT_TIMESTAMP() - 7) | sede |
CREATE TABLE table_3767 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | What is the title of the episode with a production code of 2j5504? | SELECT "Title" FROM table_3767 WHERE "Production code" = '2J5504' | wikisql |
CREATE TABLE table_21365 (
"Official Name" text,
"Status" text,
"Area km 2" text,
"Population" real,
"Census Ranking" text
) | If the area is 59.73, what is the official name? | SELECT "Official Name" FROM table_21365 WHERE "Area km 2" = '59.73' | wikisql |
CREATE TABLE table_name_11 (
performance VARCHAR,
season VARCHAR,
place VARCHAR
) | What was the performance length of the 1999 season in bydgoszcz, poland? | SELECT performance FROM table_name_11 WHERE season = 1999 AND place = "bydgoszcz, poland" | sql_create_context |
CREATE TABLE table_30120556_1 (
civil_parish VARCHAR,
townland VARCHAR,
area__acres__ VARCHAR
) | What civil paris appears when Ballynamona is the townland with 126 acres? | SELECT civil_parish FROM table_30120556_1 WHERE townland = "Ballynamona" AND area__acres__ = 126 | sql_create_context |
CREATE TABLE table_2164 (
"#" real,
"Player" text,
"Age" text,
"Australian Open" real,
"French Open" real,
"Wimbledon" real,
"US Open" real
) | When is the French Open when serena williams is the player? | SELECT MIN("French Open") FROM table_2164 WHERE "Player" = 'Serena Williams' | wikisql |
CREATE TABLE table_name_65 (
system VARCHAR,
current_version VARCHAR
) | What system has a current version of 1.4e? | SELECT system FROM table_name_65 WHERE current_version = "1.4e" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 看看患有牙折断的病人,都是开的哪些编号和名称的药品来治疗的 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.IN_DIAG_DIS_NM = '牙折断' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.IN_DIAG_DIS_... | css |
CREATE TABLE table_41772 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How much gold did South Korea get? | SELECT SUM("Gold") FROM table_41772 WHERE "Nation" = 'south korea' | wikisql |
CREATE TABLE table_67788 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
) | Tell me the year with Laps less than 197 and start of 2 | SELECT "Year" FROM table_67788 WHERE "Laps" < '197' AND "Start" = '2' | wikisql |
CREATE TABLE table_46182 (
"Barangay" text,
"Area (km\u00b2)" real,
"Population (2007)" real,
"Population (2010)" real,
"Pop. density (per km\u00b2)" real
) | What is the total number of Area (km ), when Population (2007) is 6,176? | SELECT COUNT("Area (km\u00b2)") FROM table_46182 WHERE "Population (2007)" = '6,176' | wikisql |
CREATE TABLE Claims_Processing_Stages (
Claim_Stage_ID INTEGER,
Next_Claim_Stage_ID INTEGER,
Claim_Status_Name VARCHAR(255),
Claim_Status_Description VARCHAR(255)
)
CREATE TABLE Claim_Headers (
Claim_Header_ID INTEGER,
Claim_Status_Code CHAR(15),
Claim_Type_Code CHAR(15),
Policy_ID INTE... | Bar chart x axis policy type code y axis the total number, show by the y axis in desc please. | SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_74146 (
"Institution" text,
"Team" text,
"City" text,
"Province" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Endowment" text,
"Football stadium" text,
"Capacity" real
) | How many institutions are shown for the football stadium of mosaic stadium? | SELECT COUNT("Institution") FROM table_74146 WHERE "Football stadium" = 'Mosaic Stadium' | 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 hours have passed since patient 021-80293's admission in the icu? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '021-80293' AND patient.unitdischargetime IS NULL | eicu |
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... | what did patient 23070 receive on the first icu visit as their last intake? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070) AND NOT icustays.outtime IS N... | mimic_iii |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | 就诊的病患33852265号其检验报告单上对应的检查结果指标均不正常的单号是多少? | SELECT jyjgzbb.BGDH FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '33852265' AND NOT jyjgzbb.BGDH IN (SELECT jyjgzb... | css |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate tim... | Microservices trend (# of questions per month). | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ... | sede |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | Give me the comparison about the average of Height over the Sex , and group by attribute Sex, order X-axis from low to high order. | SELECT Sex, AVG(Height) FROM people GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE table_58025 (
"Date" text,
"Track" text,
"Race" text,
"Distance" text,
"Surface track" text,
"Winning horse" text,
"Winning jockey" text
) | What is the race with the track distance of 6 furlongs and spectacular bid stakes? | SELECT "Track" FROM table_58025 WHERE "Distance" = '6 furlongs' AND "Race" = 'spectacular bid stakes' | wikisql |
CREATE TABLE exhibition_record (
exhibition_id number,
date text,
attendance number
)
CREATE TABLE artist (
artist_id number,
name text,
country text,
year_join number,
age number
)
CREATE TABLE exhibition (
exhibition_id number,
year number,
theme text,
artist_id numbe... | Return the average and minimum ages across artists from the United States. | SELECT AVG(age), MIN(age) FROM artist WHERE country = 'United States' | spider |
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... | Search usernames and about me by any keyword. | SELECT u.Id AS "user_link", u.DisplayName, u.AboutMe FROM Users AS u WHERE u.DisplayName LIKE '%##keyword1##%' OR u.AboutMe LIKE '%##keyword1##%' ORDER BY u.CreationDate DESC LIMIT 100 | sede |
CREATE TABLE table_27435931_1 (
elevation_ft INTEGER,
year VARCHAR
) | what was the lowest elevation in april 2006? | SELECT MIN(elevation_ft) FROM table_27435931_1 WHERE year = "April 2006" | sql_create_context |
CREATE TABLE table_48910 (
"Country" text,
"First store" text,
"Hypermarkets" text,
"Supermarkets" text,
"Hard Discounters" text
) | What country has 50 supermarkets? | SELECT "Country" FROM table_48910 WHERE "Supermarkets" = '50' | wikisql |
CREATE TABLE table_27354 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What number pick was Danny Walters in the 1983 NFL draft? | SELECT COUNT("Pick #") FROM table_27354 WHERE "Player" = 'Danny Walters' | wikisql |
CREATE TABLE table_name_23 (
american VARCHAR,
british VARCHAR,
initial_syllable_open_semi_open_unstressed_vowels VARCHAR
) | What is American, when British is ' , ', and when Initial-Syllable Open/Semi-Open Unstressed Vowels is ' / /'? | SELECT american FROM table_name_23 WHERE british = "ɪ, ə" AND initial_syllable_open_semi_open_unstressed_vowels = "æ /ɨ/" | sql_create_context |
CREATE TABLE table_56946 (
"Street" text,
"West" text,
"East" text,
"# of lanes" text,
"Traffic direction" text
) | What is the traffic direction of 64th street with 2nd avenue to the west and 1 lane? | SELECT "Traffic direction" FROM table_56946 WHERE "West" = '2nd avenue' AND "# of lanes" = '1' AND "Street" = '64th street' | wikisql |
CREATE TABLE table_16622 (
"Rank ( WJC )" real,
"Rank (ARDA)" real,
"Metro area" text,
"Number of Jews (WJC)" real,
"Number of Jews (ASARB)" real
) | What is the number of jews where the rank is 1? | SELECT COUNT("Number of Jews (WJC)") FROM table_16622 WHERE "Rank (ARDA)" = '1' | wikisql |
CREATE TABLE hosting_city (
Year int,
Match_ID int,
Host_City text
)
CREATE TABLE temperature (
City_ID int,
Jan real,
Feb real,
Mar real,
Apr real,
Jun real,
Jul real,
Aug real,
Sep real,
Oct real,
Nov real,
Dec real
)
CREATE TABLE city (
City_ID int,
... | A bar chart for what are the number of the venues of all the matches? Sort them in the descending order of match date. | SELECT Venue, COUNT(Venue) FROM match GROUP BY Venue ORDER BY Date DESC | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id ... | how many days does it have been since the last time patient 8116 stayed in ward 7 during their current hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116 AND admissions.dischtime IS NULL)) AND transfers.w... | mimic_iii |
CREATE TABLE table_name_95 (
capacity INTEGER,
opening VARCHAR,
city VARCHAR
) | What is the lowest capacity with an opening larger than 2015 in Trabzon? | SELECT MIN(capacity) FROM table_name_95 WHERE opening > 2015 AND city = "trabzon" | sql_create_context |
CREATE TABLE table_17029 (
"Ships name" text,
"Date entered service" text,
"Date withdrawn" text,
"Tonnage" real,
"Type of Ship" text
) | what are all the date withdrawn for koningin beatrix | SELECT "Date withdrawn" FROM table_17029 WHERE "Ships name" = 'Koningin Beatrix' | wikisql |
CREATE TABLE table_34150 (
"Ship" text,
"Original Pennant Number" text,
"Builder" text,
"Laid Down" text,
"Launched" text,
"Commissioned" text
) | what builder launched 20 jun 1953? | SELECT "Builder" FROM table_34150 WHERE "Launched" = '20 jun 1953' | wikisql |
CREATE TABLE table_name_61 (
runner_up_skip VARCHAR,
winning_skip VARCHAR
) | What person was the runner-up skip when Julie Reddick was the winning skip? | SELECT runner_up_skip FROM table_name_61 WHERE winning_skip = "julie reddick" | sql_create_context |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TAB... | Name all the difficulties for all of the CS-LSA courses . | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course, program, program_course WHERE program_course.course_id = course.course_id AND program.name LIKE 'CS-LSA' AND program.program_id = program_course.program_id | advising |
CREATE TABLE table_10839 (
"Year" real,
"Title" text,
"Role" text,
"Leading Lady" text,
"Director" text
) | Who directs before 1949 with linda darnell leading and jonathan kent? | SELECT "Director" FROM table_10839 WHERE "Year" < '1949' AND "Leading Lady" = 'linda darnell' AND "Role" = 'jonathan kent' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId n... | Questions with close votes by tag with at least two tags (multiple tags same question). | SELECT ROW_NUMBER() OVER (ORDER BY p.Id), p.Id AS "post_link", p.Tags FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE v.VoteTypeId = 6 AND p.ClosedDate IS NULL AND t.TagName IN ('##Tag1:string?tagname##', '##Tag2:string... | sede |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,... | get count of the number of hospital visits of patient 5658 in 2103. | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 5658 AND STRFTIME('%y', admissions.admittime) = '2103' | mimic_iii |
CREATE TABLE table_21952 (
"Country / Region" text,
"Name" text,
"Host(s)" text,
"Channel" text,
"Premiere / Aired" text,
"Seasons" text
) | Which channel has the host Art Rooijakkers? | SELECT "Channel" FROM table_21952 WHERE "Host(s)" = 'Art Rooijakkers' | wikisql |
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 month (
... | find travel arrangements for a one way flight from SAN FRANCISCO 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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND fare.round_trip_required = 'NO' AND flight_fare.fare_id = ... | atis |
CREATE TABLE table_62798 (
"Player" text,
"Matches" text,
"Overs" text,
"Wickets" text,
"Economy Rate" text,
"Average" text,
"Strike Rate" text
) | What is the average when the matches are 11? | SELECT "Average" FROM table_62798 WHERE "Matches" = '11' | wikisql |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_seme... | Is there a lab which belongs to 475 ? | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 475 | advising |
CREATE TABLE table_name_19 (
season VARCHAR,
oberliga_bayern VARCHAR,
oberliga_südwest VARCHAR
) | Which Season ha spvgg bayreuth and eintracht trier? | SELECT season FROM table_name_19 WHERE oberliga_bayern = "spvgg bayreuth" AND oberliga_südwest = "eintracht trier" | sql_create_context |
CREATE TABLE table_65012 (
"Date" text,
"Ship Name" text,
"Flag" text,
"Tonnage ( GRT )" real,
"Fate" text,
"Deaths" real
) | Which Tonnage has a Fate of sunk, and Deaths smaller than 17, and a Date of 16 november 1940? | SELECT "Tonnage ( GRT )" FROM table_65012 WHERE "Fate" = 'sunk' AND "Deaths" < '17' AND "Date" = '16 november 1940' | wikisql |
CREATE TABLE table_11545282_7 (
school_club_team VARCHAR,
no VARCHAR
) | What school or club did number 35 play for? | SELECT school_club_team FROM table_11545282_7 WHERE no = 35 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
u... | was the heartrate value of patient 022-163354 second measured on the first intensive care unit visit less than the value first measured on the first intensive care unit visit? | SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-163354') AND NOT patient.unitdischargetime IS... | eicu |
CREATE TABLE table_41991 (
"Round" text,
"Race" real,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning driver" text,
"Winning team" text
) | What is Date, when Fastest Lap is James Winslow, when Race is 1, and when Winning Driver is Leanne Tander? | SELECT "Date" FROM table_41991 WHERE "Fastest Lap" = 'james winslow' AND "Race" = '1' AND "Winning driver" = 'leanne tander' | wikisql |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Students (
stud... | What are the student IDs and middle names of the students enrolled in at most two courses. | SELECT T2.middle_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id | nvbench |
CREATE TABLE table_43872 (
"Name" text,
"Built" text,
"Listed" text,
"Location" text,
"County" text
) | What year was the bridge in Kent built? | SELECT "Built" FROM table_43872 WHERE "County" = 'kent' | wikisql |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE comment_instructor (
instructor_id int... | For Greek Archaeology , is there an advisory pre-requirement ? | SELECT DISTINCT advisory_requirement FROM course WHERE name LIKE '%Greek Archaeology%' | advising |
CREATE TABLE table_49092 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To Par" real,
"Money ( $ )" real
) | What is the average To Par, when Player is 'Billy Casper'? | SELECT AVG("To Par") FROM table_49092 WHERE "Player" = 'billy casper' | wikisql |
CREATE TABLE table_29976 (
"Season" real,
"Driver" text,
"Owner" text,
"Number" text,
"Make" text,
"Starts" text,
"Wins" real,
"Top Tens" real,
"Poles" real,
"Points (margin)" text
) | Name the poles for season 2006 | SELECT "Poles" FROM table_29976 WHERE "Season" = '2006' | wikisql |
CREATE TABLE Companies (
id int,
name text,
Headquarters text,
Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value_billion text
)
CREATE TABLE buildings (
id int,
name text,
City text,
Height int,
Stories int,
Status text
)
... | List the number of companies for each building in a bar chart, display name from high to low order. | SELECT T2.name, COUNT(T2.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T2.name ORDER BY T2.name DESC | nvbench |
CREATE TABLE table_name_58 (
points INTEGER,
year VARCHAR
) | What is the total point for the year listed in 1988? | SELECT SUM(points) FROM table_name_58 WHERE year = 1988 | sql_create_context |
CREATE TABLE table_10523 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | When was the home game for the NY Islanders? | SELECT "Date" FROM table_10523 WHERE "Home" = 'ny islanders' | wikisql |
CREATE TABLE table_30120633_1 (
area__acres__ INTEGER,
townland VARCHAR
) | How few acres is the area of Clashroe? | SELECT MIN(area__acres__) FROM table_30120633_1 WHERE townland = "Clashroe" | sql_create_context |
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 ethnicity is black/cape verdean and primary disease is chest pain? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "CHEST PAIN" | mimicsql_data |
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 ... | Draft: Users filtered by location and the company name (keyword in AboutMe). | SELECT DISTINCT u.Id AS "user_link", CONCAT('https://stackoverflow.com/users/', u.Id) AS "profile_link", u.DisplayName, u.Location, u.WebsiteUrl, u.AboutMe, u.Views, u.UpVotes, u.DownVotes, u.EmailHash, u.Reputation FROM Users AS u WHERE UPPER(u.Location) LIKE UPPER('%##Location##%') AND UPPER(u.AboutMe) LIKE UPPER('%#... | sede |
CREATE TABLE table_79638 (
"Round" real,
"Date" text,
"Home Team" text,
"Away Team" text,
"Attendance" real,
"Stadium" text
) | Who was the away team when Queensland Roar was the home team in the round less than 3? | SELECT "Away Team" FROM table_79638 WHERE "Round" < '3' AND "Home Team" = 'queensland roar' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
... | User Count: Users in a given location - Not Case Sensitive. | WITH UsersStatedLocation AS (SELECT CASE WHEN LOWER(Location) LIKE LOWER('##Location##') THEN 'Location Input' ELSE 'Not a match' END AS StatedLocation FROM Users WHERE LENGTH(Location) > 1) SELECT UsersStatedLocation.StatedLocation, COUNT(1) AS "count" FROM UsersStatedLocation GROUP BY UsersStatedLocation.StatedLocati... | sede |
CREATE TABLE table_1231316_4 (
wind__m_s_ VARCHAR,
country VARCHAR
) | What was the stats of Trinidad and Tobago | SELECT wind__m_s_ FROM table_1231316_4 WHERE country = "Trinidad and Tobago" | sql_create_context |
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... | provide the number of patients whose ethnicity is black/haitian and diagnoses icd9 code is v4511? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND diagnoses.icd9_code = "V4511" | 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... | Find out the age and preferred language for the patient with patient id 2560. | SELECT demographic.age, demographic.language FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
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... | Users with reputation > 5000 who never downvoted. | SELECT u.Id AS "user_link", u.DisplayName, u.Reputation, u.DownVotes, u.UpVotes, u.LastAccessDate FROM Users AS u WHERE u.Reputation > 5000 AND u.DownVotes = 0 ORDER BY u.DownVotes, u.Reputation DESC LIMIT 500 | sede |
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
)
... | give me the number of patients whose diagnoses icd9 code is 41021? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "41021" | mimicsql_data |
CREATE TABLE table_55606 (
"Season" real,
"Series" text,
"Team Name" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Final Placing" text
) | What is the total number of seasons with more than 0 wins and a 1st final placing? | SELECT COUNT("Season") FROM table_55606 WHERE "Wins" > '0' AND "Final Placing" = '1st' | wikisql |
CREATE TABLE table_37370 (
"Date" text,
"Country" text,
"Circuit" text,
"Sprint Winner" text,
"Feature Winner" text,
"Report" text
) | Which circuit was in Great Britain with Ireland as the winner? | SELECT "Circuit" FROM table_37370 WHERE "Feature Winner" = 'ireland' AND "Country" = 'great britain' | wikisql |
CREATE TABLE table_name_39 (
label VARCHAR,
format VARCHAR,
edition_s_ VARCHAR
) | Tell me the label for digital download for bonus tracks version | SELECT label FROM table_name_39 WHERE format = "digital download" AND edition_s_ = "bonus tracks version" | sql_create_context |
CREATE TABLE table_name_77 (
score VARCHAR,
country VARCHAR,
year VARCHAR
) | Which Score has a Country of england, and a Year larger than 1971? | SELECT score FROM table_name_77 WHERE country = "england" AND year > 1971 | sql_create_context |
CREATE TABLE table_name_30 (
race VARCHAR,
runners VARCHAR,
odds VARCHAR
) | Which Race has a Runners of 7 and Odds of 1/3? | SELECT race FROM table_name_30 WHERE runners = 7 AND odds = "1/3" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | calculate the total number of patients with acute upper respiratory infections of unspecified site who had a lab test for plueral fluid. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Acute upper respiratory infections of unspecified site" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_18594107_1 (
draws VARCHAR,
scored VARCHAR
) | How many draws occurred when 25 points were scored? | SELECT COUNT(draws) FROM table_18594107_1 WHERE scored = 25 | sql_create_context |
CREATE TABLE table_name_93 (
attendance VARCHAR,
opponent VARCHAR
) | What was the attendance when they played the New Orleans Saints? | SELECT attendance FROM table_name_93 WHERE opponent = "new orleans saints" | sql_create_context |
CREATE TABLE table_name_81 (
matches INTEGER,
round VARCHAR
) | What is the average Matches, when Round is Third Qualifying Round? | SELECT AVG(matches) FROM table_name_81 WHERE round = "third qualifying round" | sql_create_context |
CREATE TABLE table_26866519_1 (
director VARCHAR,
series__number VARCHAR
) | Who directed series episode number 201? | SELECT director FROM table_26866519_1 WHERE series__number = 201 | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 医疗机构3780652在04年1月2日到2015年4月17日内入院诊断疾病结果与出院诊断疾病结果不同的次数一共有几次? | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '3780652' AND IN_HOSP_DATE BETWEEN '2004-01-02' AND '2015-04-17' AND IN_DIAG_DIS_CD <> OUT_DIAG_DIS_CD | css |
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, draw a bar chart about the distribution of headquarter and the sum of code , and group by attribute headquarter, and list from high to low by the Y-axis. | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code DESC | nvbench |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 病患张高驰在2018年12月3日之前做过的检验报告在哪些住院门诊?列出这些住院就诊流水编码 | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers... | css |
CREATE TABLE table_27049 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | Who wrote the episode 'Sister Act'? | SELECT "Written by" FROM table_27049 WHERE "Title" = 'Sister Act' | wikisql |
CREATE TABLE table_name_1 (
launched VARCHAR,
languages VARCHAR
) | What is the launched date of the station in cora huichol tepehuano nahuatl language? | SELECT launched FROM table_name_1 WHERE languages = "cora huichol tepehuano nahuatl" | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostHistory (
Id number,
Po... | user info with top 10 tags. | WITH tagList AS (SELECT t.TagName, COUNT(t.TagName) AS tagCount FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS q ON pt.PostId = q.Id INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE a.OwnerUserId = @UserId AND a.PostTypeId = 2 GROUP BY t.TagName ORDER BY tagCount DESC LIMIT 10) ... | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.