context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_47 (
crowd INTEGER,
venue VARCHAR
) | How big is the Venue of Brunswick Street Oval? | SELECT SUM(crowd) FROM table_name_47 WHERE venue = "brunswick street oval" | sql_create_context |
CREATE TABLE table_9796 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | What is the name of the home captain when the result was Aus by 32 runs? | SELECT "Home captain" FROM table_9796 WHERE "Result" = 'aus by 32 runs' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | tell me the number of patients who had contrast aortogram and were discharged dead/expired. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND procedures.short_title = "Contrast aortogram" | mimicsql_data |
CREATE TABLE table_name_46 (
home_team VARCHAR,
venue VARCHAR
) | Which home team plays at victoria park? | SELECT home_team FROM table_name_46 WHERE venue = "victoria park" | sql_create_context |
CREATE TABLE table_58424 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What is the nationality of the Jazz player 1977-79? | SELECT "Nationality" FROM table_58424 WHERE "Years for Jazz" = '1977-79' | wikisql |
CREATE TABLE table_8175 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is the lowest February, when Record is '21-30-11', and when Game is greater than 62? | SELECT MIN("February") FROM table_8175 WHERE "Record" = '21-30-11' AND "Game" > '62' | wikisql |
CREATE TABLE table_name_53 (
silver INTEGER,
gold VARCHAR,
bronze VARCHAR
) | What is the average number of silver medals with more than 6 gold meals and less than 5 bronze medals? | SELECT AVG(silver) FROM table_name_53 WHERE gold > 6 AND bronze < 5 | sql_create_context |
CREATE TABLE table_55621 (
"Year" real,
"Rank" real,
"Games" real,
"Win%" real,
"Postseason" text
) | What year ranked larger than 5? | SELECT "Year" FROM table_55621 WHERE "Rank" > '5' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEP... | For those employees who did not have any job in the past, visualize the relationship between salary and manager_id . | SELECT SALARY, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_18127 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | How many parties is the incumbent Bob Brady a member of? | SELECT COUNT("Party") FROM table_18127 WHERE "Incumbent" = 'Bob Brady' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Return a scatter chart about the correlation between Team_ID and All_Games_Percent , and group by attribute All_Home. | SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY All_Home | nvbench |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 姓名是谢飞烟的那个病人在2015年3月8日之后都有哪些当时的住院就诊记录对应的检验报告单?住院期间就诊流水号是什么数字? | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '谢飞烟' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2015-03-08') | css |
CREATE TABLE table_25373 (
"Player" text,
"Games Played" real,
"Minutes" real,
"Field Goals" real,
"Three Pointers" real,
"Free Throws" real,
"Rebounds" real,
"Assists" real,
"Blocks" real,
"Steals" real,
"Points" real
) | Of the players with 50 free throws, what is the lowest number of three pointers? | SELECT MIN("Three Pointers") FROM table_25373 WHERE "Free Throws" = '50' | wikisql |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescript... | All Users Ranked by Total Votes and Percent DVs. | SELECT u.Id AS "user_link", (u.UpVotes + u.DownVotes) AS "Total Votes", CASE WHEN ((u.UpVotes + u.DownVotes) > 0) THEN ROUND(CAST(u.DownVotes AS FLOAT) / (u.UpVotes + u.DownVotes) * 100, 4) ELSE 0 END AS "% DV" FROM Users AS u WHERE (u.Reputation >= 125 OR u.DownVotes > 0) AND u.Id != -1 ORDER BY 'Total Votes' DESC, '%... | sede |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare (
fare_id int,
from_airport va... | what 's the earliest flight from PHOENIX to SALT LAKE CITY | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHOENIX' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SALT ... | atis |
CREATE TABLE table_37179 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Which loss had a record of 79-49? | SELECT "Loss" FROM table_37179 WHERE "Record" = '79-49' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime ti... | was the red blood cells value of patient 52647 measured at 2103-05-22 06:40:00 greater than the value measured at 2103-05-20 06:55:00? | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52647) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') AND labevents.charttime = '2103-05-22 06:40:00') > (SE... | mimic_iii |
CREATE TABLE table_name_44 (
away_team VARCHAR,
home_team VARCHAR
) | What away team has wrexham as the home team? | SELECT away_team FROM table_name_44 WHERE home_team = "wrexham" | sql_create_context |
CREATE TABLE table_name_18 (
total INTEGER,
fa_cup VARCHAR,
club VARCHAR,
league VARCHAR
) | What is the average total of halifax town club, which has a league less than 30 and more than 3 FA cups? | SELECT AVG(total) FROM table_name_18 WHERE club = "halifax town" AND league < 30 AND fa_cup > 3 | 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,
... | compared to last measured on the current icu visit, is heartrate of patient 017-16041 less than second to last measured on the current icu 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 = '017-16041') AND patient.unitdischargetime IS NULL... | eicu |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | how many days has passed since patient 025-64321's hospital admission? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '025-64321' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_72027 (
"Name" text,
"Reign" real,
"Days held" text,
"Location" text,
"Defenses" real
) | What is the lowest defense a champion with 345 days held has? | SELECT MIN("Defenses") FROM table_72027 WHERE "Days held" = '345' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | when patient 002-67875 received the first laboratory test in 02/2105? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-67875')) AND STRFTIME('%y-%m', lab.labresulttime) = '2105-02' ORDER BY lab.labr... | eicu |
CREATE TABLE table_69596 (
"Name" text,
"Circuit" text,
"Date" text,
"Winning drivers" text,
"Winning constructor" text,
"Report" text
) | What is the name for the Monza circuit race were Bugatti was the winning constructor? | SELECT "Name" FROM table_69596 WHERE "Winning constructor" = 'bugatti' AND "Circuit" = 'monza' | wikisql |
CREATE TABLE table_54690 (
"State" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
) | What is the highest evening gown with an average of 9.531 and swimsuit smaller than 9.449? | SELECT MAX("Evening Gown") FROM table_54690 WHERE "Average" = '9.531' AND "Swimsuit" < '9.449' | wikisql |
CREATE TABLE table_name_51 (
place VARCHAR,
score VARCHAR
) | What is the place of the 68-69-73=210? | SELECT place FROM table_name_51 WHERE score = 68 - 69 - 73 = 210 | sql_create_context |
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,... | give me the length of stay of patient 8324's last stay in the icu. | SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8324) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_77398 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
) | What team with a goals conceded smaller than 25, and a place smaller than 3? | SELECT "Team" FROM table_77398 WHERE "Goals Conceded" < '25' AND "Place" < '3' | wikisql |
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 flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE date_day (
mon... | show me all flights from NEW YORK to MIAMI on a TUESDAY with round trip fare less than 932 dollars | 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, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((DAYS_0.day_name = 'TUESDAY' AND DAYS_1.day_name = 'TUESDAY' AND fare_basis.basis_days = DAYS_1.d... | atis |
CREATE TABLE table_48533 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Crowd" real,
"Box Score" text,
"Report" text
) | What is the home team which plays at a venue called Win Entertainment Centre? | SELECT "Home team" FROM table_48533 WHERE "Venue" = 'win entertainment centre' | wikisql |
CREATE TABLE table_204_239 (
id number,
"year" number,
"title" text,
"uk" text,
"us:\nbillboard\nhot 100" text,
"us:\nbillboard\nr&b" text,
"us:\nbillboard\na/c" text,
"australia" text,
"various" text
) | which year does the artist have the most charted singles ? | SELECT "year" FROM table_204_239 GROUP BY "year" ORDER BY COUNT("title") DESC LIMIT 1 | squall |
CREATE TABLE table_204_294 (
id number,
"date" text,
"time" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) | what is the total of dates ? | SELECT COUNT("date") FROM table_204_294 | squall |
CREATE TABLE table_38291 (
"Pos." real,
"Car #" real,
"Driver" text,
"Make" text,
"Team" text
) | Which Pos has a Make of chevrolet, and a Driver of jack sprague, and a Car # smaller than 2? | SELECT SUM("Pos.") FROM table_38291 WHERE "Make" = 'chevrolet' AND "Driver" = 'jack sprague' AND "Car #" < '2' | wikisql |
CREATE TABLE table_53357 (
"Year" real,
"Film/Video" text,
"Visual Arts" text,
"Theatre" text,
"Dance" text,
"Music" text
) | In 2004, what is the Dance? | SELECT "Dance" FROM table_53357 WHERE "Year" = '2004' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, I want to show by the bar from high to low. | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID 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,
... | 门诊诊断患者柏飞鸿为煤工尘肺,他的检测指标223006的结果定量及其单位均为? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND... | css |
CREATE TABLE table_21458 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | At what game number was the attendance at Conseco Fieldhouse 14,486? | SELECT MAX("Game") FROM table_21458 WHERE "Location Attendance" = 'Conseco Fieldhouse 14,486' | wikisql |
CREATE TABLE table_8733 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | What game was the final score 82-79? | SELECT "Game" FROM table_8733 WHERE "Score" = '82-79' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,... | during their current hospital encounter, has patient 27172 been ordered with atenolol, pantoprazole sodium or vial? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27172 AND admissions.dischtime IS NULL) AND prescriptions.drug IN ('atenolol', 'pantoprazole sodium', 'vial') | mimic_iii |
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 demographic (... | calculate the maximum age of office admitted patients who had home health care discharge location. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.discharge_location = "HOME HEALTH CARE" | mimicsql_data |
CREATE TABLE table_30114 (
"Player" text,
"Matches" real,
"Innings" real,
"Wickets" real,
"Average" text,
"BBI" text,
"BBM" text,
"5wi" real
) | How many players had 12 wickets? | SELECT COUNT("Player") FROM table_30114 WHERE "Wickets" = '12' | wikisql |
CREATE TABLE table_name_47 (
finalists INTEGER,
years_won VARCHAR,
_percentage_won VARCHAR
) | How many finalists were there when the years won was 2008 and the won % was greater than 33? | SELECT SUM(finalists) FROM table_name_47 WHERE years_won = "2008" AND _percentage_won > 33 | sql_create_context |
CREATE TABLE table_14196 (
"Name" text,
"Position" text,
"Apps" real,
"Goals" real,
"Assists" real
) | What is the name of the player with more than 0 assists, a position of forward, 19 goals, and more than 84 apps? | SELECT "Name" FROM table_14196 WHERE "Assists" > '0' AND "Position" = 'forward' AND "Apps" > '84' AND "Goals" = '19' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | what is the number of patients whose diagnoses long title is long-term (current) use of anticoagulants and drug type is additive? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Long-term (current) use of anticoagulants" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
P... | Votos positivos e negativos por usuario. | SELECT * FROM Votes WHERE UserId = '##UserId##' | sede |
CREATE TABLE table_17928023_1 (
attendance VARCHAR,
week VARCHAR
) | What is the attendance record for week 6? | SELECT COUNT(attendance) FROM table_17928023_1 WHERE week = 6 | sql_create_context |
CREATE TABLE table_name_56 (
nationality VARCHAR,
player VARCHAR
) | Dave Curry has what Nationality? | SELECT nationality FROM table_name_56 WHERE player = "dave curry" | sql_create_context |
CREATE TABLE table_name_19 (
takeover_date VARCHAR,
fa_division_s_ VARCHAR
) | What is the takeover date of the FA division mitre? | SELECT takeover_date FROM table_name_19 WHERE fa_division_s_ = "mitre" | sql_create_context |
CREATE TABLE table_18099 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What was the earliest year someone was first elected from Massachusetts 3 | SELECT MIN("First elected") FROM table_18099 WHERE "District" = 'Massachusetts 3' | wikisql |
CREATE TABLE mzb (
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... | 从01年10月6日到2007年9月19日内因为科室800矽肺(硅肺)Ⅲ期而产生的住院平均花费了多少? | SELECT AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_ORG_DEPT_NM = '800' AND zyb.IN_HOSP_DAYS BETWEEN '2001-10-06' AND '2007-09-19' AND zyb.IN_HOSP_DATE = '矽肺(硅肺)Ⅲ期' | css |
CREATE TABLE table_26176081_29 (
name VARCHAR,
tfl_yds VARCHAR
) | What is the name when tfl-yds is 2-2? | SELECT name FROM table_26176081_29 WHERE tfl_yds = "2-2" | sql_create_context |
CREATE TABLE table_2508633_5 (
pick__number VARCHAR,
nfl_team VARCHAR
) | What pick number did the buffalo bills get? | SELECT pick__number FROM table_2508633_5 WHERE nfl_team = "Buffalo Bills" | sql_create_context |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row... | how many patients received a insert endotracheal tube in the same month after having previously received a sm bowel endoscopy nec since 4 years ago? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'sm bowel en... | mimic_iii |
CREATE TABLE table_51101 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What was the result of the week 9 game? | SELECT "Result" FROM table_51101 WHERE "Week" = '9' | wikisql |
CREATE TABLE table_10023387_1 (
doubles_w_l VARCHAR,
player VARCHAR
) | what's the doubles w-l for player seol jae-min (none) | SELECT doubles_w_l FROM table_10023387_1 WHERE player = "Seol Jae-Min (none)" | sql_create_context |
CREATE TABLE table_40745 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
) | What is the package/option in Italy when the content is religione? | SELECT "Package/Option" FROM table_40745 WHERE "Content" = 'religione' AND "Country" = 'italy' | wikisql |
CREATE TABLE table_name_47 (
best_dancer VARCHAR,
dance VARCHAR,
worst_dancer VARCHAR,
best_score VARCHAR
) | Who is the Best dancer with the Worst dancer of Jerry Springer, a Best score of 29, and the Dance was the Quickstep? | SELECT best_dancer FROM table_name_47 WHERE worst_dancer = "jerry springer" AND best_score = 29 AND dance = "quickstep" | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName te... | PayPal products analysis of Tag test. | SELECT * FROM Posts AS q WHERE q.Id = 34963083 AND q.CreationDate > '2016-01-01 00:00:00' AND q.CreationDate < '2017-01-01 00:00:00' | sede |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | tell me the number of patients born before 2130 who have the diagnoses of other chest pain. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2130" AND diagnoses.short_title = "Chest pain NEC" | mimicsql_data |
CREATE TABLE table_name_63 (
main_wins VARCHAR,
team VARCHAR
) | How many main wins for France? | SELECT main_wins FROM table_name_63 WHERE team = "france" | sql_create_context |
CREATE TABLE table_name_75 (
position VARCHAR,
difference VARCHAR,
against VARCHAR
) | How many positions had a difference of - 4 and an against of less than 24? | SELECT COUNT(position) FROM table_name_75 WHERE difference = "- 4" AND against < 24 | sql_create_context |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
... | Show me Elementary Persian classes which have 10 credits . | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Elementary Persian%' OR name LIKE '%Elementary Persian%') AND credits = 10 | advising |
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,
... | 从2005年11月22日到2012年7月6日这一段时间里,曹玉轩病患的所有检验报告单中的标本采集分别是哪几个部位? | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = ... | css |
CREATE TABLE table_25762852_1 (
snowfall__in_year_ INTEGER,
name VARCHAR
) | What is the snowfall for ski resort Snowmass? | SELECT MAX(snowfall__in_year_) FROM table_25762852_1 WHERE name = "Snowmass" | sql_create_context |
CREATE TABLE table_49438 (
"Borough" text,
"1970" real,
"1980" real,
"1990" real,
"2000" real,
"2006" real
) | What was the percentage in 1980 that had less than 37.8% in 2006, more than 29.4% in 2000, and more than 18.2% in 1970? | SELECT MIN("1980") FROM table_49438 WHERE "2006" < '37.8' AND "2000" > '29.4' AND "1970" > '18.2' | wikisql |
CREATE TABLE table_name_43 (
sponsor VARCHAR,
date_introduced VARCHAR
) | Who was the sponsor on April 22, 2004? | SELECT sponsor FROM table_name_43 WHERE date_introduced = "april 22, 2004" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name, and list Y in descending order. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE table_49756 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | what is the city when the country is libya and the iata is ben? | SELECT "City" FROM table_49756 WHERE "Country" = 'libya' AND "IATA" = 'ben' | wikisql |
CREATE TABLE table_23285849_11 (
location_attendance VARCHAR,
high_points VARCHAR
) | When carmelo anthony (39) has the highest amount of points where is the location and what is the attendance? | SELECT location_attendance FROM table_23285849_11 WHERE high_points = "Carmelo Anthony (39)" | sql_create_context |
CREATE TABLE table_6076 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | In the tournament with more than 6 top-25's and less than 13 cuts made, how many wins were there? | SELECT COUNT("Wins") FROM table_6076 WHERE "Top-25" > '6' AND "Cuts made" < '13' | wikisql |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, show me about the distribution of name and the sum of revenue , and group by attribute name in a bar chart, show Name in descending order. | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_64960 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text,
"Arena" text,
"Points" real
) | Which Arena has Points larger than 28, and a Date of december 14? | SELECT "Arena" FROM table_64960 WHERE "Points" > '28' AND "Date" = 'december 14' | wikisql |
CREATE TABLE table_4756 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was St Kilda's away team score? | SELECT "Away team score" FROM table_4756 WHERE "Away team" = 'st kilda' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 门诊就诊48598074227的就诊状态代码是什么?就诊状态名称叫什么? | SELECT JZZTDM, JZZTMC FROM mzjzjlb WHERE JZLSH = '48598074227' | css |
CREATE TABLE table_name_50 (
lane VARCHAR,
name VARCHAR
) | Swimmer Jiao Liuyang has what for the sum of lane? | SELECT COUNT(lane) FROM table_name_50 WHERE name = "jiao liuyang" | sql_create_context |
CREATE TABLE table_name_44 (
year VARCHAR,
team VARCHAR
) | What are the years that Andretti Autosport is a team? | SELECT COUNT(year) FROM table_name_44 WHERE team = "andretti autosport" | 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 diagnoses long title is encephalopathy, unspecified and procedure short title is spinal tap? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE diagnoses.long_title = "Encephalopathy, unspecified" AND procedures.short_title = "Spinal tap" | mimicsql_data |
CREATE TABLE table_23670057_6 (
height__f_ VARCHAR,
year_born VARCHAR,
height__m_ VARCHAR
) | Name the height for the player born 1989 and height 2.11 | SELECT height__f_ FROM table_23670057_6 WHERE year_born = 1989 AND height__m_ = "2.11" | 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 primary disease and diagnoses icd9 code of subject name kelly gallardo? | SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
CREATE TABLE table_7200 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What's the most recent week for the day of November 5, 1978? | SELECT MAX("Week") FROM table_7200 WHERE "Date" = 'november 5, 1978' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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 ... | 汉防己甲素片(薄膜衣)在医院就诊号码77570477407中的收费项目中等级是多少? | SELECT t_kc22.CHA_ITEM_LEV FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '77570477407' AND t_kc22.SOC_SRT_DIRE_NM = '汉防己甲素片(薄膜衣)' | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | how many white -russian patients had diagnosis under icd9 code 30501? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND diagnoses.icd9_code = "30501" | mimicsql_data |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labi... | what is the number of patients who died after diagnosis of periph vascular dis nos in the same month this year? | SELECT COUNT(DISTINCT t2.subject_id) 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 = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... | mimic_iii |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program (
program_id int,
name varchar,
... | Is there a section of BIOMATLS 569 that meets on a day other than Monday next semester ? | SELECT DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'BIOMATLS' AND course.number = 569 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semest... | advising |
CREATE TABLE table_71036 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | What is the total number that Tom Watson parred larger than 10? | SELECT COUNT("Total") FROM table_71036 WHERE "Player" = 'tom watson' AND "To par" > '10' | wikisql |
CREATE TABLE table_65575 (
"School" text,
"Location" text,
"Mascot" text,
"Size" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
) | Winchester Community school, which plays IHSAA class AA football, is located where? | SELECT "Location" FROM table_65575 WHERE "IHSAA Football Class" = 'aa' AND "School" = 'winchester community' | wikisql |
CREATE TABLE table_name_99 (
area_served VARCHAR,
callsign VARCHAR
) | Which area served has a Callsign of 5ddn? | SELECT area_served FROM table_name_99 WHERE callsign = "5ddn" | sql_create_context |
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... | how many patients had the drug code hepa10s and ascites as the lab test fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "HEPA10S" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | A bar chart shows the distribution of All_Home and the average of Team_ID , and group by attribute All_Home, and order X from low to high order. | SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home | nvbench |
CREATE TABLE table_73150 (
"#" real,
"Episode" text,
"UK air date" text,
"Timeslot" text,
"Viewers (millions)" text,
"Audience share in timeslot" text
) | Name the most number for viewers being 6.95 | SELECT MAX("#") FROM table_73150 WHERE "Viewers (millions)" = '6.95' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | 列出患者49963274的检验报告单中结果指标均正常的检验报告单号 | (SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '49963274' AND NOT jybgb.BGDH IN (SELECT BGDH FROM jyjgzbb WHERE JCZ... | css |
CREATE TABLE table_203_377 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the name of the only nation that did not earn any bronze medals ? | SELECT "nation" FROM table_203_377 WHERE "bronze" = 0 | squall |
CREATE TABLE broadcast_share (
Channel_ID int,
Program_ID int,
Date text,
Share_in_percent real
)
CREATE TABLE program (
Program_ID int,
Name text,
Origin text,
Launch real,
Owner text
)
CREATE TABLE broadcast (
Channel_ID int,
Program_ID int,
Time_of_day text
)
CREATE... | Draw a bar chart of owner versus total number of rating in percent | SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose admission year is less than 2158 and lab test name is theophylline? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2158" AND lab.label = "Theophylline" | mimicsql_data |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of salary over the job_id , and group by attribute job_id. | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID | nvbench |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_... | in 04/this year, had nicardipine iv ever been prescribed to patient 77586? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77586) AND prescriptions.drug = 'nicardipine iv' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m',... | mimic_iii |
CREATE TABLE table_name_66 (
nationality VARCHAR,
position VARCHAR,
college_junior_club_team__league_ VARCHAR
) | What nationality is the draft pick with w position from leninogorsk (russia-2)? | SELECT nationality FROM table_name_66 WHERE position = "w" AND college_junior_club_team__league_ = "leninogorsk (russia-2)" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 在2016年5月1日到2016年12月18日内医院0660177门诊医疗记录的数量是多少? | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '0660177' AND IN_HOSP_DATE BETWEEN '2016-05-01' AND '2016-12-18' AND CLINIC_TYPE = '门诊' | css |
CREATE TABLE table_47239 (
"1998" text,
"2000" text,
"2004" text,
"2007" text,
"2011" text
) | What is the 1998 value if the 2007 value is 8? | SELECT "1998" FROM table_47239 WHERE "2007" = '8' | wikisql |
CREATE TABLE table_10420426_1 (
poles VARCHAR,
team VARCHAR
) | What is the total number of poles for arden international? | SELECT COUNT(poles) FROM table_10420426_1 WHERE team = "Arden International" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.