context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_12789 (
"Tournament" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"Win %" text
) | What is the winning % for the 2010 QF? | SELECT "Win %" FROM table_12789 WHERE "2010" = 'qf' | wikisql |
CREATE TABLE table_51795 (
"Year" text,
"Team" text,
"Comp" text,
"Long" text,
"Rate" text,
"RAtt" text,
"RYds" text,
"RAvg" text
) | What is the RAvg of the year with Ratt of 9? | SELECT "RAvg" FROM table_51795 WHERE "RAtt" = '9' | wikisql |
CREATE TABLE table_7503 (
"Date" text,
"Tournament" text,
"Venue" text,
"Opponent" text,
"Result" text
) | What was the result of the game played on May 9, 2012? | SELECT "Result" FROM table_7503 WHERE "Date" = 'may 9, 2012' | wikisql |
CREATE TABLE table_66880 (
"Year" real,
"Artist" text,
"Album" text,
"Record label" text,
"Weeks at number one" real
) | What's the sum of years when the Artist of the queen were less than 1? | SELECT COUNT("Year") FROM table_66880 WHERE "Artist" = 'queen' AND "Weeks at number one" < '1' | wikisql |
CREATE TABLE table_74563 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" text
) | Tell me the lowest week for attendance of 60,894 | SELECT MIN("Week") FROM table_74563 WHERE "Attendance" = '60,894' | wikisql |
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,... | 19242256这个病人在哪几次医疗记录中被开出过的药品不少于3101.15元,医疗就诊编号是啥 | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '19242256' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT < 3101.15) | css |
CREATE TABLE table_30016 (
"Province" text,
"Provincial capital" text,
"Commandery" text,
"Commandery capital" text,
"No. of counties" real
) | When yidu is the commandery what is the lowest number of countries? | SELECT MIN("No. of counties") FROM table_30016 WHERE "Commandery" = 'Yidu 宜都' | wikisql |
CREATE TABLE table_41178 (
"Team" text,
"Match" text,
"Points" text,
"Draw" text,
"Lost" text
) | What is the Lost when the points were dissolved? | SELECT "Lost" FROM table_41178 WHERE "Points" = 'dissolved' | wikisql |
CREATE TABLE table_name_14 (
ranking VARCHAR,
season VARCHAR
) | Which Ranking has a Season of 2009? | SELECT ranking FROM table_name_14 WHERE season = "2009" | sql_create_context |
CREATE TABLE table_name_14 (
winner VARCHAR,
loser VARCHAR,
result VARCHAR
) | Which team won against the New England Patriots 40-21? | SELECT winner FROM table_name_14 WHERE loser = "new england patriots" AND result = "40-21" | sql_create_context |
CREATE TABLE table_77211 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the place of Australia? | SELECT "Place" FROM table_77211 WHERE "Country" = 'australia' | wikisql |
CREATE TABLE table_26718 (
"Pitcher" text,
"Strikeouts" real,
"Season" real,
"Team" text,
"League" text,
"Overall Rank" real
) | Name the league for strikeouts being 451 | SELECT "League" FROM table_26718 WHERE "Strikeouts" = '451' | wikisql |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 列出患者31659348在6659356这个医院中被开过什么单价最高的药?列出这个药的编码、名称和单价 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '31659348' AND gwyjzb.MED_SER_ORG_NO = '6659356' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '31659348' AND fg... | css |
CREATE TABLE table_20107 (
"No" real,
"Driver" text,
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text
) | Who drove car 44? | SELECT "Driver" FROM table_20107 WHERE "No" = '44' | wikisql |
CREATE TABLE table_name_32 (
top_25 INTEGER,
events VARCHAR,
tournament VARCHAR
) | What is the average of the top-25 of those with less than 35 events in the Open Championship? | SELECT AVG(top_25) FROM table_name_32 WHERE events < 35 AND tournament = "the open championship" | sql_create_context |
CREATE TABLE TEACHERS (
gender VARCHAR,
last_name VARCHAR
) | What is the gender of the teacher with last name 'Medhurst'? | SELECT gender FROM TEACHERS WHERE last_name = "Medhurst" | sql_create_context |
CREATE TABLE table_204_508 (
id number,
"no." number,
"race title" text,
"track" text,
"date" text,
"tv" text
) | which race occurred before the sfp 250 ? | SELECT "race title" FROM table_204_508 WHERE id = (SELECT id FROM table_204_508 WHERE "race title" = 'sfp 250') - 1 | squall |
CREATE TABLE table_19747 (
"Team" text,
"Copa Libertadores 1998" text,
"Copa Mercosur 1998" text,
"Copa CONMEBOL 1998" text,
"Copa Interamericana 1998" text,
"Recopa Sudamericana 1998" text,
"Intercontinental Cup 1998" text
) | What were Cruzeiro results in the Copa Mercosur in 1998 | SELECT "Copa Mercosur 1998" FROM table_19747 WHERE "Team" = 'Cruzeiro' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients are admitted before the year 2137 and tested with fibrinogen functional in lab? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2137" AND lab.label = "Fibrinogen, Functional" | mimicsql_data |
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... | Show me about the proportion of the sum of Height and the sum of Height in a pie chart. | SELECT Sex, SUM(Height) FROM people GROUP BY Sex | nvbench |
CREATE TABLE table_204_923 (
id number,
"club" text,
"entered\nadministration" text,
"exited\nadministration" text,
"league(s)" text,
"deduction(s)" text
) | how many clubs at most do n't have leagues ? | SELECT COUNT("club") FROM table_204_923 WHERE "league(s)" IS NULL | squall |
CREATE TABLE table_30612 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | What was the title of the episode with production code 2J5515? | SELECT "Title" FROM table_30612 WHERE "Production code" = '2J5515' | wikisql |
CREATE TABLE tracks (
id number,
name text,
album_id number,
media_type_id number,
genre_id number,
composer text,
milliseconds number,
bytes number,
unit_price number
)
CREATE TABLE playlist_tracks (
playlist_id number,
track_id number
)
CREATE TABLE genres (
id number... | How many orders does Lucas Mancini has? | SELECT COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini" | spider |
CREATE TABLE table_1371 (
"Vertical" real,
"Horizontal" real,
"Aspect ratio" text,
"Pixel aspect ratio" text,
"Form of scanning" text,
"Framerate ( Hz )" text
) | Name the aspect ratio for 720 | SELECT "Aspect ratio" FROM table_1371 WHERE "Horizontal" = '720' | wikisql |
CREATE TABLE table_name_74 (
to_par VARCHAR,
year_s__won VARCHAR
) | What was the score to par in 1960? | SELECT to_par FROM table_name_74 WHERE year_s__won = "1960" | 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... | 施和畅这个病人在4094247这家医院的就诊记录中,查询在一零年九月二十五日到一三年二月八日期间开出的所有药品和编号 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '施和畅' AND t_kc22.t_kc21_MED_SER_ORG_NO = '4094247' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2010-09-25' AND '2013-02-08') | css |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(2... | For all employees who have the letters D or S in their first name, find job_id and the average of manager_id , and group by attribute job_id, and visualize them by a bar chart, order mean manager id from low to high order please. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_nam... | when was last time patient 30614 was measured with a arterial bp mean greater than 77.0 on the first icu visit? | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30614) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (... | mimic_iii |
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
)
... | give me the number of patients whose admission type is emergency and procedure long title is injection or infusion of platelet inhibitor? | 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.long_title = "Injection or infusion of platelet inhibitor" | mimicsql_data |
CREATE TABLE table_32938 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What is the result week 6? | SELECT "Result" FROM table_32938 WHERE "Week" = '6' | wikisql |
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,... | 章傲晴这位患者以前做了哪些检查呢? | 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.PERSON_NM = '章傲晴' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
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... | 二零零四年六月十八日二零一一年六月十三日,在9385529医院有多少科室涉及医疗费总额低于4.11元 | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '9385529' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-18' AND '2011-06-13' GROUP B... | css |
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 the number of patients whose ethnicity is black/cape verdean that had a lab test named potassium ,urine. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND lab.label = "Potassium, Urine" | mimicsql_data |
CREATE TABLE table_14966667_19 (
hometown VARCHAR,
position VARCHAR
) | how many hometowns use the position of fs? | SELECT COUNT(hometown) FROM table_14966667_19 WHERE position = "FS" | sql_create_context |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Tit... | Top 200 Users in Columbus, Oh. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%san%fran%' ORDER BY Reputation DESC LIMIT 200 | sede |
CREATE TABLE table_7264 (
"Position" text,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"Previous Club/Team" text
) | Which Height (cm) has a Position of d, and a Name of jeff hymanson? | SELECT MIN("Height (cm)") FROM table_7264 WHERE "Position" = 'd' AND "Name" = 'jeff hymanson' | wikisql |
CREATE TABLE table_name_79 (
event VARCHAR,
opponent VARCHAR
) | What is the Event when the opponent was wesslan evaristo de oliveira? | SELECT event FROM table_name_79 WHERE opponent = "wesslan evaristo de oliveira" | sql_create_context |
CREATE TABLE table_19753079_4 (
incumbent VARCHAR,
district VARCHAR
) | Name the incumbent for alabama 6 | SELECT incumbent FROM table_19753079_4 WHERE district = "Alabama 6" | sql_create_context |
CREATE TABLE table_68889 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | Who played in the men's singles during the tournament where Ragna Ingolfsdottir played in the women's singles? | SELECT "Men's singles" FROM table_68889 WHERE "Women's singles" = 'ragna ingolfsdottir' | wikisql |
CREATE TABLE table_37726 (
"Favorite professional sport" text,
"2005" text,
"2008" text,
"2011" text,
"2012" text
) | What is listed for the 2012 that has a 2011 of 28.9%? | SELECT "2012" FROM table_37726 WHERE "2011" = '28.9%' | wikisql |
CREATE TABLE table_name_72 (
venue VARCHAR,
result VARCHAR
) | Tell me the venue with result of eng by 6 wkts | SELECT venue FROM table_name_72 WHERE result = "eng by 6 wkts" | sql_create_context |
CREATE TABLE table_1342393_23 (
party VARCHAR,
first_elected VARCHAR
) | What was the party for first elected 1923? | SELECT party FROM table_1342393_23 WHERE first_elected = 1923 | sql_create_context |
CREATE TABLE table_1745843_6 (
class VARCHAR,
part_3 VARCHAR
) | How many different classes of verbs are there whose part 3 is lucon? | SELECT COUNT(class) FROM table_1745843_6 WHERE part_3 = "lucon" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE i... | how did patient 011-49649 go into the hospital the last time since 2104. | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '011-49649' AND STRFTIME('%y', patient.hospitaladmittime) >= '2104' ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_62804 (
"Time" text,
"Show Name" text,
"Local/Networked" text,
"Ad Freq" text,
"News Freq" text
) | What is the ad frequency for the show named Health Matters? | SELECT "Ad Freq" FROM table_62804 WHERE "Show Name" = 'health matters' | wikisql |
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... | Number of questions closed per month. | SELECT LAST_DATE_OF_MONTH(ClosedDate) AS "month_closed", COUNT(*) AS "count" FROM Posts WHERE NOT ClosedDate IS NULL GROUP BY LAST_DATE_OF_MONTH(ClosedDate) ORDER BY LAST_DATE_OF_MONTH(ClosedDate) | sede |
CREATE TABLE table_33416 (
"Rank" real,
"Player" text,
"Years" text,
"Games" real,
"Reb. Avg." real,
"Total Rebounds" real
) | How many ranks have a rebound average smaller than 6.1? | SELECT COUNT("Rank") FROM table_33416 WHERE "Reb. Avg." < '6.1' | wikisql |
CREATE TABLE shop (
Shop_ID int,
Address text,
Num_of_staff text,
Score real,
Open_Year text
)
CREATE TABLE member (
Member_ID int,
Name text,
Membership_card text,
Age int,
Time_of_purchase int,
Level_of_membership int,
Address text
)
CREATE TABLE happy_hour_member (
... | Bar graph to show the total number from different address, show in desc by the Y-axis please. | SELECT Address, COUNT(*) FROM member GROUP BY Address ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 在2005年11月3日到2007年9月11日期间患者张嘉惠就诊医生数有多少人? | SELECT COUNT(mzjzjlb.ZZYSGH) 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 mzjzjlb.JZKSRQ BETWEEN '2005-11-03' AND '2007-09-11' | css |
CREATE TABLE table_name_78 (
margin_of_victory VARCHAR,
tournament VARCHAR
) | What was the margin of victory for Olazabal in the German Masters? | SELECT margin_of_victory FROM table_name_78 WHERE tournament = "german masters" | sql_create_context |
CREATE TABLE table_2618 (
"Office" text,
"Type" text,
"Location" text,
"Elected" text,
"Term began" text,
"Term ended" text
) | When did the term began when the date of election is N/A? | SELECT "Term began" FROM table_2618 WHERE "Elected" = 'N/A' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | how many hours have passed since the first time patient 004-79017 was given a #2: intake on the current icu visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description... | Average Answer Score by Content Length. Investigating the effects of tl;dr | SELECT (LENGTH(Body) / '##ChunkSize:int##') * '##ChunkSize##' AS size, AVG(CAST(Score AS FLOAT)) AS "average answer score", (SELECT MAX(Score) FROM (SELECT percent AS score FROM Posts AS PU WHERE PostTypeId = 2 ORDER BY Score LIMIT 50) AS t) AS "median answer score", COUNT(*) AS answers FROM Posts WHERE PostTypeId = 2 ... | sede |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnon... | Trending Users: All Votes vs Votes for recent content. Draft SQL for statistics for http://meta.stackoverflow.com/questions/134614 | SELECT v.CreationDate, vt.Name, p.Id, p.CreationDate FROM Posts AS p, Votes AS v, VoteTypes AS vt WHERE v.PostId = p.Id AND v.VoteTypeId = vt.Id AND p.OwnerUserId = 122457 AND p.Id = 6270545 | sede |
CREATE TABLE table_61021 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Which Country has a To par of 9? | SELECT "Country" FROM table_61021 WHERE "To par" = '–9' | wikisql |
CREATE TABLE table_name_58 (
wkts INTEGER,
ovrs VARCHAR,
player VARCHAR
) | If Adam Voges had less than 28.5 Ovrs, what are his highest Wkts? | SELECT MAX(wkts) FROM table_name_58 WHERE ovrs < 28.5 AND player = "adam voges" | sql_create_context |
CREATE TABLE table_25380472_2 (
game_site VARCHAR,
team_record VARCHAR
) | How many game sites are there where the team record is 1 7? | SELECT COUNT(game_site) FROM table_25380472_2 WHERE team_record = "1–7" | sql_create_context |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
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 varch... | List the courses that satisfy the MDE requirement in Phys Princ Smart Dev ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Phys Princ Smart Dev%' OR course.description LIKE '%Phys Princ Smart Dev%' OR course.name LIKE '... | advising |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE diagnosis (
diagn... | what were the drugs that were added to patient 006-47576 today, compared to those yesterday? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-47576') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica... | eicu |
CREATE TABLE table_64107 (
"School" text,
"Location" text,
"Mascot" text,
"Size" real,
"IHSAA Class" text,
"# / County" text,
"Year Joined" real,
"Previous Conference" text
) | What's the previous conference of Fountain City with a size more than 287? | SELECT "Previous Conference" FROM table_64107 WHERE "Size" > '287' AND "Location" = 'fountain city' | wikisql |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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,
... | 看看编号92525342038的检验报告单检验项目代码及名称分别是什么 | SELECT jybgb.JYXMDM, jybgb.JYXMMC FROM jybgb WHERE jybgb.BGDH = '92525342038' | css |
CREATE TABLE table_18360 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Who were the candidates in the districts that was first elected in 1966? | SELECT "Candidates" FROM table_18360 WHERE "First elected" = '1966' | wikisql |
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,
... | provide the number of patients whose admission type is elective and procedure long title is automatic implantable cardioverter/defibrillator (aicd) check? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Automatic implantable cardioverter/defibrillator (AICD) check" | 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,
... | 医疗机构8198670在零二年六月八日到零二年九月二十日内的总金额和统筹总金额分别如何 | SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '8198670' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-06-08' AND '2002-09-20' UNION SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.ME... | css |
CREATE TABLE table_name_64 (
netflix VARCHAR,
series_ep VARCHAR
) | What is the Netflix episode for series episode 15-01? | SELECT netflix FROM table_name_64 WHERE series_ep = "15-01" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | what is the top three diagnosis that have the highest five year mortality rate? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... | mimic_iii |
CREATE TABLE table_name_35 (
high_rebounds VARCHAR,
date VARCHAR
) | What were the high rebounds on september 11? | SELECT high_rebounds FROM table_name_35 WHERE date = "september 11" | sql_create_context |
CREATE TABLE table_name_39 (
result_f___a VARCHAR,
h___a VARCHAR
) | What was the result of the game played in hurst? | SELECT result_f___a FROM table_name_39 WHERE h___a = "hurst" | sql_create_context |
CREATE TABLE table_4877 (
"Place" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real
) | What is the highest number of plays when drawn is more than 4, more than 30 points were earned, and 37 goals scored for the team? | SELECT MAX("Played") FROM table_4877 WHERE "Drawn" > '4' AND "Goals For" = '37' AND "Points" > '30' | wikisql |
CREATE TABLE table_11545282_17 (
player VARCHAR,
years_for_jazz VARCHAR
) | What is the player that played 2004-05? | SELECT player FROM table_11545282_17 WHERE years_for_jazz = "2004-05" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid tex... | what is the two year survival rate for pneumonia - hospital acquired (not ventilator-associated) patients who were prescribed diphenhydramine hcl? | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
CREATE TABLE table_40118 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the lowest number of Drawn games for Team Mackenzie where the Played is less and 11 and the Points are greater than 7? | SELECT MIN("Drawn") FROM table_40118 WHERE "Played" < '11' AND "Points" > '7' AND "Team" = 'mackenzie' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
... | Questions by unique users about Mobile testing. | SELECT P.OwnerUserId, COUNT(P.Title) FROM Posts AS P WHERE (P.Tags LIKE '%android-testing%') OR (P.Tags LIKE '%robotium%') OR (P.Tags LIKE '%androidviewclient%') OR (P.Tags LIKE '%monkeyrunner%') OR (P.Tags LIKE '%android-espresso%') OR (P.Tags LIKE '%android-emulator%') OR (P.Tags LIKE '%android%' AND P.Tags LIKE '%ui... | sede |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE time_inte... | i'd like a flight tomorrow from SAN DIEGO to TORONTO | 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 = 'TORONTO' AND date_day.day_number = 20 AND date_day.month_number = 1 AND d... | atis |
CREATE TABLE table_name_90 (
team_2 VARCHAR
) | What is the 2nd leg of pelister team 2? | SELECT 2 AS nd_leg FROM table_name_90 WHERE team_2 = "pelister" | sql_create_context |
CREATE TABLE table_39887 (
"Match No." text,
"Home Team" text,
"Score" text,
"Away Team" text,
"Attendance" text
) | What is the score of the game that had 359 people in attendance? | SELECT "Score" FROM table_39887 WHERE "Attendance" = '359' | wikisql |
CREATE TABLE table_79185 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | On what date was Tie #13 played? | SELECT "Date" FROM table_79185 WHERE "Tie no" = '13' | wikisql |
CREATE TABLE table_name_60 (
stage INTEGER,
difficulty VARCHAR,
start VARCHAR
) | What is the lowest stage number that starts with els alocs and has a middle difficulty? | SELECT MIN(stage) FROM table_name_60 WHERE difficulty = "middle" AND start = "els alocs" | sql_create_context |
CREATE TABLE table_20454 (
"S No" real,
"Team (A)" text,
"Team (B)" text,
"Winner" text,
"Margin" text,
"Match Date" text
) | Namethe team for feb 27, 1996 | SELECT "Team (A)" FROM table_20454 WHERE "Match Date" = 'Feb 27, 1996' | wikisql |
CREATE TABLE table_name_67 (
hometown VARCHAR,
delegate VARCHAR
) | What's the hometown of rachel muyot soriano? | SELECT hometown FROM table_name_67 WHERE delegate = "rachel muyot soriano" | sql_create_context |
CREATE TABLE table_name_18 (
attendance INTEGER,
record VARCHAR,
week VARCHAR
) | Record of 8 1, and a Week larger than 9 had what highest attendance? | SELECT MAX(attendance) FROM table_name_18 WHERE record = "8–1" AND week > 9 | sql_create_context |
CREATE TABLE gyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 医疗机构8198670在零二年六月八日到零二年九月二十日内的总金额和统筹总金额分别如何 | SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '8198670' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-06-08' AND '2002-09-20' UNION SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_k... | css |
CREATE TABLE table_name_14 (
rank VARCHAR,
nation VARCHAR,
total VARCHAR
) | What's the rank of Turkey (TUR) with a total more than 2? | SELECT COUNT(rank) FROM table_name_14 WHERE nation = "turkey (tur)" AND total > 2 | sql_create_context |
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,
... | Find the number of matches in different competitions Visualize by bar chart, and show in descending by the bars. | SELECT Competition, COUNT(*) FROM match GROUP BY Competition ORDER BY Competition DESC | nvbench |
CREATE TABLE table_10943 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the away team at glenferrie oval? | SELECT "Away team" FROM table_10943 WHERE "Venue" = 'glenferrie oval' | wikisql |
CREATE TABLE table_39255 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many bronze medals did Bulgaria receive? | SELECT "Bronze" FROM table_39255 WHERE "Nation" = 'bulgaria' | wikisql |
CREATE TABLE table_test_22 (
"id" int,
"ejection_fraction_ef" int,
"pregnancy_or_lactation" bool,
"child_pugh_class" string,
"hbv" bool,
"systolic_blood_pressure_sbp" int,
"active_infection" bool,
"leukocyte_count" int,
"hiv_infection" bool,
"left_ventricular_dysfunction" bool,
... | known leucopenia, defined as a leukocyte count of < 3500 white blood cells ( wbc ) / ml | SELECT * FROM table_test_22 WHERE leucopenia = 1 OR leukocyte_count < 3500 | criteria2sql |
CREATE TABLE table_name_16 (
born_died VARCHAR,
country VARCHAR
) | What is the Born-Died date for the Representative of Italy? | SELECT born_died FROM table_name_16 WHERE country = "italy" | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | has patient 009-10951 ever had allergy during this year? | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-10951')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURRE... | eicu |
CREATE TABLE table_name_97 (
res VARCHAR,
event VARCHAR
) | What is the result for pfc: put up or shut up? | SELECT res FROM table_name_97 WHERE event = "pfc: put up or shut up" | sql_create_context |
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE t... | Bar graph to show how many location from different location | SELECT Location, COUNT(Location) FROM station GROUP BY Location | nvbench |
CREATE TABLE table_name_80 (
entrant VARCHAR,
engine VARCHAR,
driver VARCHAR
) | What is the Entrant with a Engine of talbot l6, and Eug ne Chaboud was the driver? | SELECT entrant FROM table_name_80 WHERE engine = "talbot l6" AND driver = "eugène chaboud" | sql_create_context |
CREATE TABLE table_name_88 (
streak VARCHAR,
date VARCHAR,
team_points VARCHAR,
game VARCHAR
) | Which streak before game 12 had a team points larger than 113 on November 16? | SELECT streak FROM table_name_88 WHERE team_points > 113 AND game < 12 AND date = "november 16" | sql_create_context |
CREATE TABLE table_name_13 (
rank INTEGER,
earnings___$__ INTEGER
) | What is the high rank for players earning over $533,929? | SELECT MAX(rank) FROM table_name_13 WHERE earnings___$__ > 533 OFFSET 929 | sql_create_context |
CREATE TABLE table_name_64 (
tournament VARCHAR
) | Which tournament had a 2010 result of QF and a 2012 result of SF? | SELECT tournament FROM table_name_64 WHERE 2012 = "sf" AND 2010 = "qf" | sql_create_context |
CREATE TABLE table_50417 (
"City" text,
"State" text,
"2010 population" text,
"Peak population (year)" text,
"Numeric decline from peak population" text,
"Percent decline from peak population" text
) | what is the state when the peak population (year) is 134995 (1950)? | SELECT "State" FROM table_50417 WHERE "Peak population (year)" = '134995 (1950)' | wikisql |
CREATE TABLE Nurse (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
Registered BOOLEAN,
SSN INTEGER
)
CREATE TABLE Trained_In (
Physician INTEGER,
Treatment INTEGER,
CertificationDate DATETIME,
CertificationExpires DATETIME
)
CREATE TABLE Medication (
Code INTEGER,... | Find the physicians who are trained in a procedure that costs more than 5000, and count them by a bar chart | SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name | nvbench |
CREATE TABLE table_55575 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the score of the away team in the match at Princes Park? | SELECT "Away team score" FROM table_55575 WHERE "Venue" = 'princes park' | wikisql |
CREATE TABLE table_name_93 (
laps INTEGER,
grid VARCHAR,
time VARCHAR
) | What is the highest number of Laps that have a Time of +18.366, and a Grid lower than 13? | SELECT MAX(laps) FROM table_name_93 WHERE grid < 13 AND time = "+18.366" | sql_create_context |
CREATE TABLE table_24580 (
"Round #" real,
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/junior/club team" text
) | Which nationality is player Brian Wilks? | SELECT "Nationality" FROM table_24580 WHERE "Player" = 'Brian Wilks' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.