context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many patients whose admission year is less than 2200 and procedure long title is other bronchoscopy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2200" AND procedures.long_title = "Other bronchoscopy" | mimicsql_data |
CREATE TABLE table_32201 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What is the name of a running back in a round before round 3? | SELECT "Player" FROM table_32201 WHERE "Round" < '3' AND "Position" = 'running back' | wikisql |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | calculate the five year survival rate of the patients diagnosed with hematoma complic proc. | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... | mimic_iii |
CREATE TABLE fzzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | 在患者卫光临的诊疗记录里,从04年6月8日到21年1月17日这期间,为其检测指标224990的医务人员有哪几位,报一下工号及姓名 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZ... | css |
CREATE TABLE t_kc21 (
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,
... | 病患编号41538489在医院7012713入院确诊的疾病名称里包括了未字的医疗就医记录都是多少编号? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '41538489' AND t_kc21.MED_SER_ORG_NO = '7012713' AND t_kc21.IN_DIAG_DIS_NM LIKE '%未%' | css |
CREATE TABLE table_name_25 (
location VARCHAR,
game VARCHAR,
points VARCHAR
) | Which game has a number lower than 57 and more than 50 points? | SELECT location FROM table_name_25 WHERE game < 57 AND points > 50 | sql_create_context |
CREATE TABLE table_19924 (
"Series Ep." text,
"Episode" real,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | What is the segment A on episode 237? | SELECT "Segment A" FROM table_19924 WHERE "Episode" = '237' | wikisql |
CREATE TABLE table_45301 (
"Type" text,
"Construction period" text,
"Cylinder" text,
"Capacity" text,
"Power" text,
"Vmax" text
) | What was the maximum speed for the P4-1 (24/36 ps)? | SELECT "Vmax" FROM table_45301 WHERE "Type" = 'p4-1 (24/36 ps)' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | Top 200 User from Iran. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Users.Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%iran%' OR UPPER(Location) LIKE 'IR') ORDER BY Reputation DESC LIMIT 200 | sede |
CREATE TABLE table_77310 (
"Year" real,
"Award Ceremony" text,
"Category" text,
"Show" text,
"Character" text,
"Result" text
) | Which character was nominated in the 2010 Indian Television Academy Awards? | SELECT "Character" FROM table_77310 WHERE "Year" = '2010' AND "Award Ceremony" = 'indian television academy awards' | wikisql |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | Number of questions where Accepted Answer < Top voted answer and Accepted Answer > 3. | SELECT COUNT(p.Id) FROM Posts AS p, Posts AS a WHERE p.PostTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL AND a.Id = p.AcceptedAnswerId AND (SELECT MAX(Score) FROM Posts AS q WHERE q.ParentId = p.Id) > a.Score AND a.Score > 3 | 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... | 在05年4月2日到17年9月13日期间,看看医院9519124的小儿青光眼科科室涉及的医疗总额有多少 | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '9519124' AND t_kc24.t_kc21_MED_ORG_DEPT_NM = '小儿青光眼科') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-04-02' AND '2017-09-13' | css |
CREATE TABLE table_50566 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner and score" text,
"Finalist" text,
"Semifinalists" text
) | Which Surface has Semifinalists of wally masur malivai washington? | SELECT "Surface" FROM table_50566 WHERE "Semifinalists" = 'wally masur malivai washington' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | For those employees who was hired before 2002-06-21, for manager_id, hire_date, visualize the trend, and display X-axis in descending order. | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_name_1 (
stadium VARCHAR,
host_team VARCHAR
) | What is the Stadium that hosts the team Jacksonville Jaguars? | SELECT stadium FROM table_name_1 WHERE host_team = "jacksonville jaguars" | sql_create_context |
CREATE TABLE pitstops (
raceid number,
driverid number,
stop number,
lap number,
time text,
duration text,
milliseconds number
)
CREATE TABLE drivers (
driverid number,
driverref text,
number number,
code text,
forename text,
surname text,
dob text,
nationali... | How many drivers did not participate in the races held in 2009? | SELECT COUNT(DISTINCT driverid) FROM results WHERE NOT raceid IN (SELECT raceid FROM races WHERE year <> 2009) | spider |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, give me the comparison about the amount of headquarter over the headquarter , and group by attribute headquarter, I want to rank by the bars in ascending. | SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter | nvbench |
CREATE TABLE table_name_21 (
home_captain VARCHAR,
result VARCHAR
) | Which home captian has aus by 295 runs as the result? | SELECT home_captain FROM table_name_21 WHERE result = "aus by 295 runs" | sql_create_context |
CREATE TABLE table_29077342_19 (
points_classification VARCHAR,
general_classification VARCHAR
) | Name the points classification for levi leipheimer | SELECT points_classification FROM table_29077342_19 WHERE general_classification = "Levi Leipheimer" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | was patient 006-172277 excreting any output (ml)-urethral catheter temperature probe 18 fr. during this hospital encounter? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-172277' AND patient.hospitaldischargetime IS NULL)) AND intakeoutp... | eicu |
CREATE TABLE ref_calendar (
calendar_date time,
day_number number
)
CREATE TABLE employees (
employee_id number,
role_code text,
employee_name text,
gender_mfu text,
date_of_birth time,
other_details text
)
CREATE TABLE ref_locations (
location_code text,
location_name text,
... | How many calendar items do we have? | SELECT COUNT(*) FROM ref_calendar | spider |
CREATE TABLE table_7887 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" text,
"Record" text,
"Points" real
) | What home team has an n/a attendance? | SELECT "Home" FROM table_7887 WHERE "Attendance" = 'n/a' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | what is since 12/2105 maximum tacrolimus-fk506 value of patient 008-40862? | SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-40862')) AND lab.labname = 'tacrolimus-fk506' AND STRFTIME('%y-%m', lab.labres... | eicu |
CREATE TABLE table_46553 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | what is the total when bronze is 0 and the nation is hungary? | SELECT MAX("Total") FROM table_46553 WHERE "Bronze" = '0' AND "Nation" = 'hungary' | wikisql |
CREATE TABLE table_name_31 (
tournament VARCHAR,
finalist VARCHAR
) | WHich Tournament has a Finalist of gustavo kuerten (4)? | SELECT tournament FROM table_name_31 WHERE finalist = "gustavo kuerten (4)" | sql_create_context |
CREATE TABLE table_name_44 (
overall INTEGER,
college VARCHAR
) | What is the number that is the lowest overall for the College of Baylor? | SELECT MIN(overall) FROM table_name_44 WHERE college = "baylor" | sql_create_context |
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 ... | 患者63825529的842142指标在06年12月24日到11年5月11日期间是怎样的 | SELECT * 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 = '63825529' AND jyjgzbb.JYRQ BETWEEN '2006-12-24' AND '2011-0... | css |
CREATE TABLE table_69268 (
"Race" text,
"Dist (f)" real,
"Course" text,
"Prize (\u00a3K)" real,
"Runners" real,
"Placing" real,
"Margin" text,
"Jockey" text,
"Trainer" text
) | Which course had a jockey of Royston FFrench? | SELECT "Course" FROM table_69268 WHERE "Jockey" = 'royston ffrench' | wikisql |
CREATE TABLE table_58450 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What result has a Score of 1 0, and a Competition of 2014 fifa world cup qualification? | SELECT "Result" FROM table_58450 WHERE "Score" = '1–0' AND "Competition" = '2014 fifa world cup qualification' | wikisql |
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... | 在6998667这个医院的患者魏烨磊,他的出院诊断疾病名称中不包括楔状缺损的医疗就诊记录编号是哪些 | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '魏烨磊' AND qtb.MED_SER_ORG_NO = '6998667' AND NOT qtb.OUT_DIAG_DIS_NM LIKE '%楔状缺损%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '魏烨磊' AND gyb.MED_SER_ORG_NO = '6998667' AND NOT gyb.OUT_DIAG_DIS_NM LIKE '%楔状缺损%' UNION SELECT zyb.MED_CLINIC_ID FROM ... | css |
CREATE TABLE table_27303975_2 (
format VARCHAR,
title VARCHAR
) | Name the format for super callanetics | SELECT format FROM table_27303975_2 WHERE title = "Super Callanetics" | sql_create_context |
CREATE TABLE table_68033 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Which Entrant has an Engine of climax straight-4, and Points larger than 0? | SELECT "Entrant" FROM table_68033 WHERE "Engine" = 'climax straight-4' AND "Points" > '0' | wikisql |
CREATE TABLE table_name_20 (
home_team VARCHAR,
crowd INTEGER
) | Who was the home team at the game with a crowd larger than 32,576? | SELECT home_team AS score FROM table_name_20 WHERE crowd > 32 OFFSET 576 | sql_create_context |
CREATE TABLE table_64341 (
"Class" text,
"Railway number(s)" text,
"Quantity" real,
"Year(s) of manufacture" text,
"Type" text
) | Which Class has a Quantity larger than 96? | SELECT "Class" FROM table_64341 WHERE "Quantity" > '96' | wikisql |
CREATE TABLE table_15112 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | Name the game site with result of w 20-14 | SELECT "Game site" FROM table_15112 WHERE "Result" = 'w 20-14' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time... | explain meal codes SD/D | SELECT DISTINCT compartment, meal_code, meal_description, meal_number FROM food_service WHERE meal_code = 'SD/D' | atis |
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... | Top 500 Users in India. It will gives you Top 500 Users who belongs to India. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%IND' ORDER BY Reputation DESC LIMIT 5000 | sede |
CREATE TABLE table_24510 (
"Series #" real,
"Title" text,
"Story #" real,
"Artist" text,
"Strip numbers" text,
"Number of strips" text,
"Dates of original publication of strip" text
) | What is the series number for the Golden Frog? | SELECT "Series #" FROM table_24510 WHERE "Title" = 'The Golden Frog' | wikisql |
CREATE TABLE table_name_13 (
total VARCHAR,
player VARCHAR,
to_par VARCHAR,
finish VARCHAR
) | What is the Total, when To Par is less than 14, when Finish is T12, and when Player is 'Julius Boros'? | SELECT total FROM table_name_13 WHERE to_par < 14 AND finish = "t12" AND player = "julius boros" | sql_create_context |
CREATE TABLE txmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 患者54076263049是哪天来的门诊就诊? | SELECT txmzjzjlb.JZKSRQ FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '54076263049' UNION SELECT ftxmzjzjlb.JZKSRQ FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '54076263049' | 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... | tell me the name of the patient with patient id 3284. | SELECT demographic.name FROM demographic WHERE demographic.subject_id = "3284" | mimicsql_data |
CREATE TABLE seasons (
year number,
url text
)
CREATE TABLE races (
raceid number,
year number,
round number,
circuitid number,
name text,
date text,
time text,
url text
)
CREATE TABLE constructorstandings (
constructorstandingsid number,
raceid number,
constructori... | What is the name and date of the race that occurred most recently? | SELECT name, date FROM races ORDER BY date DESC LIMIT 1 | spider |
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 lab (
labid numbe... | calculate one year survival probability of patients who were prescribed furosemide 40 mg tab after having been diagnosed with stroke - ischemic stroke? | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 1 * 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_58216 (
"Date" text,
"Competition" text,
"Venue" text,
"Result" text,
"Score" text,
"Goals" text
) | What is the score at shay stadium? | SELECT "Score" FROM table_58216 WHERE "Venue" = 'shay stadium' | wikisql |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | What is MATSCIE 489 ? | SELECT DISTINCT name FROM course WHERE department = 'MATSCIE' AND number = 489 | advising |
CREATE TABLE table_48811 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Who is the player from the United States in T4 place with a score of 68-73-68=209? | SELECT "Player" FROM table_48811 WHERE "Country" = 'united states' AND "Place" = 't4' AND "Score" = '68-73-68=209' | wikisql |
CREATE TABLE table_5053 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | On what date was Game 1? | SELECT "Date" FROM table_5053 WHERE "Game" = 'game 1' | wikisql |
CREATE TABLE table_70885 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What was the most recent year for Dean Van Lines? | SELECT MAX("Year") FROM table_70885 WHERE "Entrant" = 'dean van lines' | wikisql |
CREATE TABLE table_18870 (
"District" text,
"2010 Population (000)" real,
"2008 GDP (USD bn) a" text,
"2008 GDP per capita (USD) a" real,
"Agri culture b" text,
"Mining b" text,
"Manufac turing b" text,
"Services & cons truction b" text,
"Exports (USD mn) 2011" real,
"Median mo. ... | How low was the income where services is 72.5? | SELECT "Income poverty f" FROM table_18870 WHERE "Services & cons truction b" = '72.5' | wikisql |
CREATE TABLE table_49933 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What country is player Raymond Floyd from? | SELECT "Country" FROM table_49933 WHERE "Player" = 'raymond floyd' | 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,... | 从10年3月17日起到2015年1月5日结束西帕依固龈液成功开出的总数量及总金各有多少? | SELECT SUM(QTY), SUM(AMOUNT) FROM t_kc22 WHERE SOC_SRT_DIRE_NM = '西帕依固龈液' AND STA_DATE BETWEEN '2010-03-17' AND '2015-01-05' | css |
CREATE TABLE table_18162 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Results" text,
"Candidates" text
) | In what district was Tim Holden the incumbent? | SELECT "District" FROM table_18162 WHERE "Incumbent" = 'Tim Holden' | wikisql |
CREATE TABLE table_23411 (
"No. overall" text,
"No. in series" real,
"Family/families" text,
"Location(s)" text,
"Original air date" text
) | Name the family for uk31 | SELECT "Family/families" FROM table_23411 WHERE "No. overall" = 'UK31' | wikisql |
CREATE TABLE mill (
architect_id number,
id number,
location text,
name text,
type text,
built_year number,
notes text
)
CREATE TABLE bridge (
architect_id number,
id number,
name text,
location text,
length_meters number,
length_feet number
)
CREATE TABLE architect... | What are the names of the mills which are not located in 'Donceel'? | SELECT name FROM mill WHERE location <> 'Donceel' | spider |
CREATE TABLE table_7480 (
"Year" real,
"Events played" real,
"Cuts made" real,
"Wins" real,
"2nds" real,
"Top 10s" real,
"Best finish" text,
"Earnings ($)" real,
"Rank" text,
"Scoring average" real,
"Scoring rank" text
) | What is the lowest Cuts made with less than 72.48 scoring average? | SELECT MIN("Cuts made") FROM table_7480 WHERE "Scoring average" < '72.48' | wikisql |
CREATE TABLE table_66086 (
"Frequency" text,
"Call sign" text,
"Branding" text,
"Format" text,
"Owner" text
) | What is the call sign for country station fm 93.1? | SELECT "Call sign" FROM table_66086 WHERE "Format" = 'country' AND "Frequency" = 'fm 93.1' | wikisql |
CREATE TABLE table_204_267 (
id number,
"tie no" number,
"home team" text,
"score" text,
"away team" text,
"date" text
) | how many games had no points scored ? | SELECT COUNT(*) FROM table_204_267 WHERE "score" + "score" = 0 | squall |
CREATE TABLE table_name_10 (
election VARCHAR
) | Which 1st Party has an Election of 1893 by-election? | SELECT 1 AS st_party FROM table_name_10 WHERE election = "1893 by-election" | sql_create_context |
CREATE TABLE table_29938 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the record when the high points is listed as Stephen Curry (32)? | SELECT "Record" FROM table_29938 WHERE "High points" = 'Stephen Curry (32)' | wikisql |
CREATE TABLE table_16049 (
"\u2193 Function / Genus \u2192" text,
"Shigella" text,
"Salmonella" text,
"Yersinia" text,
"Escherichia" text
) | what's the salmonella with escherichia being sepb (escn) | SELECT "Salmonella" FROM table_16049 WHERE "Escherichia" = 'SepB (EscN)' | wikisql |
CREATE TABLE table_name_18 (
official_website VARCHAR,
dish VARCHAR,
callsign VARCHAR
) | Name the official website which has dish of and callsign of kvtv | SELECT official_website FROM table_name_18 WHERE dish = "•" AND callsign = "kvtv" | sql_create_context |
CREATE TABLE table_name_44 (
date VARCHAR,
attendance VARCHAR
) | On what date was the attendance a bye? | SELECT date FROM table_name_44 WHERE attendance = "bye" | 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,... | 列出对于病人80270684医疗记录里医疗费总额高于3516.12元的入院诊断疾病编号是什么?其名称叫什么? | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '80270684' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 3516.12) | css |
CREATE TABLE table_47157 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" real
) | Which Lost has Drawn larger than 12, and Goals Against of 54? | SELECT MAX("Lost") FROM table_47157 WHERE "Drawn" > '12' AND "Goals Against" = '54' | wikisql |
CREATE TABLE fzzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | 在医院3470456中科室名有变态反应这几个字的就诊科室的门诊中,有哪些是病患范秀逸的就诊记录流水号 | SELECT zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '范秀逸' AND hz_info.YLJGDM = '3470456' AND zzmzjzjlb.JZKSMC LIKE '%变态反应%' UNION SELECT fzzmzjzjl... | css |
CREATE TABLE table_23047 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | Name the result for dolly parton | SELECT "Result" FROM table_23047 WHERE "Original artist" = 'Dolly Parton' | wikisql |
CREATE TABLE table_42727 (
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What is the To par when fredrik andersson hed was runner-up? | SELECT "To par" FROM table_42727 WHERE "Runner(s)-up" = 'fredrik andersson hed' | wikisql |
CREATE TABLE table_name_31 (
payment VARCHAR,
type VARCHAR,
release_date VARCHAR
) | Which Payment has a Type of 2d, and a Release date of january 2003? | SELECT payment FROM table_name_31 WHERE type = "2d" AND release_date = "january 2003" | sql_create_context |
CREATE TABLE table_name_37 (
record VARCHAR,
opponent VARCHAR
) | what is the record when the opponent is jeff williams? | SELECT record FROM table_name_37 WHERE opponent = "jeff williams" | sql_create_context |
CREATE TABLE table_name_77 (
recipient VARCHAR,
play VARCHAR,
year VARCHAR
) | Name the recipient of much ado about nothing for 1973 | SELECT recipient FROM table_name_77 WHERE play = "much ado about nothing" AND year = 1973 | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name t... | WHERE with LIKE and percent signs. | SELECT * FROM dbo.Tags WHERE TagName LIKE '%sql%' | sede |
CREATE TABLE Customer_Payments (
customer_id INTEGER,
datetime_payment DATETIME,
payment_method_code VARCHAR(10),
amount_payment DOUBLE
)
CREATE TABLE Vehicles (
vehicle_id INTEGER,
vehicle_details VARCHAR(255)
)
CREATE TABLE Staff (
staff_id INTEGER,
staff_address_id INTEGER,
nick... | For each payment method, how many payments were made Show bar chart, display y-axis in desc order. | SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code ORDER BY COUNT(*) DESC | nvbench |
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 lab (
subject_id text,
hadm_id text,
... | look for the number of urgent hospital admission patients who have procedure icd9 code 9229. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.icd9_code = "9229" | mimicsql_data |
CREATE TABLE table_4024 (
"Representative" text,
"Party" text,
"Years" text,
"Congress" text,
"District Home" text,
"Occupation" text,
"Electoral history" text
) | How many entries are listed for party during the 69th congress? | SELECT COUNT("Party") FROM table_4024 WHERE "Congress" = '69th' | wikisql |
CREATE TABLE locations (
location_id number,
street_address text,
postal_code text,
city text,
state_province text,
country_id text
)
CREATE TABLE job_history (
employee_id number,
start_date time,
end_date time,
job_id text,
department_id number
)
CREATE TABLE countries (
... | What are the employee ids for those who had two or more jobs. | SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_name_1 (
final_four VARCHAR,
conference VARCHAR
) | How many Big 12 teams made it to the Final Four? | SELECT final_four FROM table_name_1 WHERE conference = "big 12" | sql_create_context |
CREATE TABLE table_11651 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away score when there was a game at Junction Oval? | SELECT "Away team score" FROM table_11651 WHERE "Venue" = 'junction oval' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 列出在医院7538695中患者50999365名称不包含过敏症的门诊诊断有哪些门诊就诊记录? | SELECT * FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i... | 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 me the number of patients whose admission type is newborn? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" | mimicsql_data |
CREATE TABLE table_28034 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | What was the minimum touchdowns of the Fullback player? | SELECT MIN("Touchdowns") FROM table_28034 WHERE "Position" = 'Fullback' | wikisql |
CREATE TABLE table_name_31 (
draw INTEGER,
artist VARCHAR
) | Emilya Valenti has what draw average? | SELECT AVG(draw) FROM table_name_31 WHERE artist = "emilya valenti" | sql_create_context |
CREATE TABLE table_name_83 (
ofsted VARCHAR,
capacity VARCHAR
) | Which Ofsted has a Capacity of 1677? | SELECT ofsted FROM table_name_83 WHERE capacity = 1677 | sql_create_context |
CREATE TABLE table_name_6 (
year VARCHAR,
start VARCHAR
) | What year did he start at 13? | SELECT year FROM table_name_6 WHERE start = "13" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 从08年5月22日起到08年11月21日患者54662739的所有检验结果指标记录中的检测方法可以提供一下吗? | SELECT jyjgzbb.JCFF 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_in... | css |
CREATE TABLE zyb (
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... | 自二零一零年九月四日开始,截止到二零一三年八月十日,患者64711366的病历里最主要的是哪种病 | SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '64711366' AND qtb.IN_HOSP_DATE BETWEEN '2011-08-23' AND '2013-08-10' GROUP BY qtb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '64711366' AND gyb.IN_HOSP_DATE... | css |
CREATE TABLE table_203_299 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | list the other competitions besides european u23 championship that came in 1st position ? | SELECT "competition" FROM table_203_299 WHERE "competition" <> 'european u23 championships' AND "position" = 1 | squall |
CREATE TABLE table_204_710 (
id number,
"model" text,
"origin" text,
"type" text,
"versions" text,
"in service" text,
"notes" text
) | which is the last versions on the chart | SELECT "model" FROM table_204_710 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
C... | Questions with highest total reputation of answerers. | SELECT RANK() OVER (ORDER BY SUM(u.Reputation) DESC) AS Rank, q.Id AS "post_link", SUM(u.Reputation) AS "total_reputation", COUNT(a.Id) AS "#_of_answers" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id INNER JOIN Users AS u ON u.Id = a.OwnerUserId GROUP BY q.Id ORDER BY SUM(u.Reputation) DESC LIMIT 100 | sede |
CREATE TABLE table_11303072_5 (
batting_team VARCHAR,
runs VARCHAR
) | What is the batting team where the runs are 276? | SELECT batting_team FROM table_11303072_5 WHERE runs = "276" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | how many enoxaparin sodium 40 mg/0.4ml sc soln prescriptions were ordered until 4 years ago? | SELECT COUNT(*) FROM medication WHERE medication.drugname = 'enoxaparin sodium 40 mg/0.4ml sc soln' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-4 year') | eicu |
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
CREATE TABLE Addresses (
address_id INTEGER,
line_1 VARCHAR(120),
line_2 VARCHAR(120),
line_3 VARCHAR(120),
city VARCHAR(80),
zip_postcode VARCHAR(20),
state_province_county VARC... | A line chart for what are the number of the dates of the assessment notes? | SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes | nvbench |
CREATE TABLE table_name_84 (
Id VARCHAR
) | What's the 1994 if 1995 has a 1R? | SELECT 1994 FROM table_name_84 WHERE 1995 = "1r" | sql_create_context |
CREATE TABLE table_72903 (
"Athlete" text,
"Event" text,
"Round of 32" text,
"Round of 16" text,
"Quarterfinals" text,
"Semifinals" text
) | Which athlete competed in the flyweight division? | SELECT "Athlete" FROM table_72903 WHERE "Event" = 'Flyweight' | wikisql |
CREATE TABLE table_name_99 (
away_team VARCHAR,
home_team VARCHAR
) | Who was away team at the home game of south melbourne? | SELECT away_team FROM table_name_99 WHERE home_team = "south melbourne" | sql_create_context |
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,
Amount_Payment INTEGER
)
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Cu... | Return the claim start date for the claims whose claimed amount is no more than the averag, and count them by a bar chart, and order by the Y-axis in asc. | SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims) ORDER BY COUNT(Date_Claim_Made) | nvbench |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | For all employees who have the letters D or S in their first name, visualize a scatter chart about the correlation between commission_pct and department_id . | SELECT COMMISSION_PCT, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
... | Which upper level classes let you earn 15 credits ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 15 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | how much is the average total hospital cost that includes s/p thoracoscopic procedure - lung reduction since 2105? | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 's/p thoracoscopic procedure - lung reduction... | eicu |
CREATE TABLE table_1342379_23 (
result VARCHAR,
incumbent VARCHAR
) | what's the result with incumbent being bill g. lowrey | SELECT result FROM table_1342379_23 WHERE incumbent = "Bill G. Lowrey" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how many days has been passed since the last time patient 005-48105 stayed in ward 267 in the current hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '005-48105' AND patient.wardid = 267 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.