context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_77 (
position VARCHAR,
year_born__age_ VARCHAR,
current_club VARCHAR,
height VARCHAR
) | What is the position for the player from the Alba Berlin club who is taller than 1.96 and whose ear born (Age) is july 23, 1985 (age28)? | SELECT position FROM table_name_77 WHERE current_club = "alba berlin" AND height > 1.96 AND year_born__age_ = "july 23, 1985 (age28)" | sql_create_context |
CREATE TABLE subjects (
subject_id number,
subject_name text
)
CREATE TABLE students (
student_id number,
date_of_registration time,
date_of_latest_logon time,
login_name text,
password text,
personal_name text,
middle_name text,
family_name text
)
CREATE TABLE student_tests_ta... | Which student are enrolled in at least two courses? Give me the student ID and personal name. | SELECT T1.student_id, T2.personal_name FROM student_course_enrolment AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_204_498 (
id number,
"location" text,
"building" text,
"year" number,
"km" number,
"monument" number
) | what km comes after 8.25 , but before | SELECT "km" FROM table_204_498 WHERE id = (SELECT id FROM table_204_498 WHERE "km" = 8.25) + 1 | squall |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | how many patients are new born with admission location as clinic referral/premature? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "NEWBORN" | mimicsql_data |
CREATE TABLE table_45023 (
"Antibody" text,
"Brand name" text,
"Approval date" real,
"Type" text,
"Target" text
) | What's the type for the brand herceptin with an approval date of before 2006? | SELECT "Type" FROM table_45023 WHERE "Approval date" < '2006' AND "Brand name" = 'herceptin' | wikisql |
CREATE TABLE table_1886270_1 (
built VARCHAR,
hr_name VARCHAR
) | When (river garry) is the hr name how many builts are there? | SELECT COUNT(built) FROM table_1886270_1 WHERE hr_name = "(River Garry)" | sql_create_context |
CREATE TABLE diagnoses (
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,
... | how many patients whose age is less than 85 and lab test name is other cells? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "85" AND lab.label = "Other Cells" | mimicsql_data |
CREATE TABLE table_18737 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Which district was the race between john i. nolan (r) 87% thomas f. feeley (s) 13%? | SELECT "District" FROM table_18737 WHERE "Candidates" = 'John I. Nolan (R) 87% Thomas F. Feeley (S) 13%' | wikisql |
CREATE TABLE table_27086613_5 (
league_apps INTEGER,
total_apps VARCHAR
) | Name the least league apps for total apps of 5 | SELECT MIN(league_apps) FROM table_27086613_5 WHERE total_apps = 5 | sql_create_context |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_20... | Show me about the distribution of meter_700 and meter_100 in a bar chart. | SELECT meter_700, meter_100 FROM swimmer | nvbench |
CREATE TABLE table_3825 (
"Season" text,
"Competition" text,
"Stage" text,
"Result" text,
"Opponent" text,
"Scorers" text
) | Who was the opponent in the Women's Cup 0 0 where Branc o Couto 0 is the scorer? | SELECT "Opponent" FROM table_3825 WHERE "Competition" = 'Women''s Cup 0 0' AND "Scorers" = 'Brancão Couto 0' | wikisql |
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE TABLE classroom (
building varchar(15... | How many instructors are in each department? Show me a bar chart, and show by the y axis from high to low. | SELECT T1.dept_name, COUNT(DISTINCT T3.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY COUNT(DISTINCT T3.ID) DESC | nvbench |
CREATE TABLE table_413 (
"Jurisdiction" text,
"Voted Yes" real,
"Percent Yes" text,
"Voted No" real,
"Percent No" text
) | what's the percent yes where voted yes is 2410119 | SELECT "Percent Yes" FROM table_413 WHERE "Voted Yes" = '2410119' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Top users by average non-deleted answer score. List of top users by average non-deleted and non-community wiki answer score. | SELECT Users.Id AS "user_link", COUNT(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_answer_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, DisplayName HAVING COUNT(Posts.Id) > '#... | sede |
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 5 StackOverflow members in Kolkata. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%kolkata%' OR UPPER(Location) LIKE '%KOLKATA%' OR Location LIKE '%kolkata%' ORDER BY Reputation DESC LIMIT 5 | sede |
CREATE TABLE table_26731 (
"Season" text,
"Champions" text,
"Runner-up" text,
"Third Place" text,
"Top Goalscorer" text,
"Club" text
) | Who was the top goalscorer for season 2001-02? | SELECT "Top Goalscorer" FROM table_26731 WHERE "Season" = '2001-02' | wikisql |
CREATE TABLE table_204_489 (
id number,
"rank" number,
"name" text,
"height" text,
"floors" number,
"year" number,
"notes" text
) | what is the number of floors of the oldest building ? | SELECT "floors" FROM table_204_489 ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_78134 (
"Tallangatta DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What are the fewest draws with less than 7 losses and Mitta United is the Tallagatta DFL? | SELECT MIN("Draws") FROM table_78134 WHERE "Losses" < '7' AND "Tallangatta DFL" = 'mitta united' | wikisql |
CREATE TABLE table_46837 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What game was Minnesota the team? | SELECT COUNT("Game") FROM table_46837 WHERE "Team" = 'minnesota' | wikisql |
CREATE TABLE table_name_21 (
home_team VARCHAR,
tie_no VARCHAR
) | WHAT IS THE HOME TEAM WITH A TIE OF 14? | SELECT home_team FROM table_name_21 WHERE tie_no = "14" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subje... | when was the last time in 10/2104 that patient 14990 was prescribed with lisinopril and potassium chloride at the same time? | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'lisinopril' AND admissions.subject_id = 14990 AND STRFTIME('%y-%m', prescriptions.startdate) = '2104-10') AS t1 JOIN (SELECT admiss... | mimic_iii |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
) | A bar chart about what is the average rating star for each reviewer?, could you show x axis from high to low order? | SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY name DESC | nvbench |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE c... | has patient 86792 been prescribed any medications since 2101. | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86792) AND STRFTIME('%y', prescriptions.startdate) >= '2101' | mimic_iii |
CREATE TABLE table_8286 (
"Player" text,
"PL Apps" real,
"PL G" real,
"CL Apps" real,
"CL G" real,
"FAC / LC Apps" real,
"FAC / LC G" real,
"Total Apps" real,
"Total G" real,
"FA YC" real,
"UEFA YC" real
) | What is the sum of the FAC/LC apps with less than 25 PC apps and a UEFA YC less than 0? | SELECT SUM("FAC / LC Apps") FROM table_8286 WHERE "PL Apps" < '25' AND "UEFA YC" < '0' | wikisql |
CREATE TABLE table_name_63 (
opposing_teams VARCHAR,
date VARCHAR
) | What opposing teams playing on 11/04/1999? | SELECT opposing_teams FROM table_name_63 WHERE date = "11/04/1999" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 统计医疗记录中的入院诊断为C22.756在医院3153932的最低医疗费总额是多少?最高医疗费总额是多少? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '3153932' AND qtb.IN_DIAG_DIS_CD = 'C22.756' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '3153932' AND gyb.IN_DIAG_DIS_CD = 'C22.756' UNION S... | css |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CR... | Total Number of Duplicated Questions. | SELECT COUNT(*) AS count FROM Posts WHERE PostTypeId = 2 | sede |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 医疗就诊12288488200的病情描述是怎么说的? | SELECT MAIN_COND_DES FROM t_kc21 WHERE MED_CLINIC_ID = '12288488200' | css |
CREATE TABLE table_train_105 (
"id" int,
"mini_mental_state_examination_mmse" int,
"systolic_blood_pressure_sbp" int,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"age" float,
"NOUSE" float
) | younger than the age of 50 or older than the age of 90 . | SELECT * FROM table_train_105 WHERE age < 50 OR age > 90 | criteria2sql |
CREATE TABLE table_77518 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
) | what is the average losses when the wins is 3? | SELECT AVG("Losses") FROM table_77518 WHERE "Wins" = '3' | wikisql |
CREATE TABLE table_name_65 (
year VARCHAR,
venue VARCHAR,
winner VARCHAR,
runner_up VARCHAR
) | When is the winner panathinaikos, the runner-up olympiacos and the venue nikos goumas stadium? | SELECT year FROM table_name_65 WHERE winner = "panathinaikos" AND runner_up = "olympiacos" AND venue = "nikos goumas stadium" | sql_create_context |
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 demographic (
subject_id text,
hadm_id t... | how many patients whose discharge location is home and days of hospital stay is greater than 17? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "17" | mimicsql_data |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | 从2001年6月3日开始2019年7月2日之内新生儿的门诊就诊记录数量在医疗机构2084494中一共有多少? | SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '2084494' AND mzjzjlb.JZKSRQ BETWEEN '2001-06-03' AND '2019-07-02' AND mzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId numb... | sequence 1, 2, 3, 3, 2, 1 v2. | WITH numbers(v) AS (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) FROM (VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9)) AS n0(x)) SELECT ord = @n * (v + 2 * m) + n, n * (1 - v) + ABS(-@n - 1 + n) * v FROM (SELECT v FROM numbers ORDER BY v LIMIT @n) AS n(n) CROSS JOIN (VALUES (0), (1)) AS s(v) CROSS JOIN (SELECT... | sede |
CREATE TABLE table_29747178_2 (
written_by VARCHAR,
directed_by VARCHAR
) | Who is the writer when the director is bob berlinger? | SELECT written_by FROM table_29747178_2 WHERE directed_by = "Bob Berlinger" | sql_create_context |
CREATE TABLE table_204_108 (
id number,
"typ" text,
"construction time" text,
"cylinders" text,
"capacity" text,
"power" text,
"top speed" text
) | which typ has the most capacity ? | SELECT "typ" FROM table_204_108 ORDER BY "capacity" DESC LIMIT 1 | squall |
CREATE TABLE table_36383 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | Which segment a's Netflix is S05E22? | SELECT "Segment A" FROM table_36383 WHERE "Netflix" = 's05e22' | wikisql |
CREATE TABLE table_name_45 (
qiangshu INTEGER,
rank VARCHAR,
jianshu VARCHAR
) | What is the average Qiangshu lower than rank 4 and less than 9.22 Jianshu? | SELECT AVG(qiangshu) FROM table_name_45 WHERE rank > 4 AND jianshu < 9.22 | sql_create_context |
CREATE TABLE table_name_9 (
lost INTEGER,
points_1 VARCHAR,
goals_against VARCHAR
) | What is the maximum lost with points 1 more than 58 and 66 goals against? | SELECT MAX(lost) FROM table_name_9 WHERE points_1 > 58 AND goals_against = 66 | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTyp... | # Users able to flag. | SELECT COUNT(*) FROM Users WHERE Reputation >= 15 | sede |
CREATE TABLE table_204_891 (
id number,
"name" text,
"hanzi" text,
"population (2005)" number,
"area (km2)" number
) | which division had the larger area ? | SELECT "name" FROM table_204_891 ORDER BY "area (km2)" DESC LIMIT 1 | squall |
CREATE TABLE table_name_91 (
played VARCHAR,
goal_difference VARCHAR
) | What is Played, when Goal Difference is '+51'? | SELECT played FROM table_name_91 WHERE goal_difference = "+51" | sql_create_context |
CREATE TABLE table_13869651_3 (
release_date VARCHAR,
part_number_s_ VARCHAR
) | When's the release date of the model with part number adh485biaa5do? | SELECT release_date FROM table_13869651_3 WHERE part_number_s_ = "ADH485BIAA5DO" | sql_create_context |
CREATE TABLE table_72509 (
"Position" real,
"Club (City/Town)" text,
"Games Played" real,
"W-L-D" text,
"Goals For/Against" text,
"Points" real
) | what is the minimum games played with goals for/against being 7-5 | SELECT MIN("Games Played") FROM table_72509 WHERE "Goals For/Against" = '7-5' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text... | 报告时间均在2013年5月12日之后编码为24113912病患的哪些门诊就诊记录对应的检验报告单?排出流水号在门诊就诊是多少? | SELECT mzjzjlb.JZLSH 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.RYBH = '24113912' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2013-05-12') | css |
CREATE TABLE table_name_45 (
gold INTEGER,
bronze VARCHAR,
silver VARCHAR
) | What is the lowest Gold count if the Bronze is 4 and Silver is greater than 5? | SELECT MIN(gold) FROM table_name_45 WHERE bronze = 4 AND silver > 5 | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 pat... | indicate the yearly average amount of temperature c (calc) for patient 26995 since 895 days ago. | SELECT AVG(chartevents.valuenum) 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 = 26995)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temp... | mimic_iii |
CREATE TABLE table_60492 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Which country had a t4 place and scored 66-73=139? | SELECT "Country" FROM table_60492 WHERE "Place" = 't4' AND "Score" = '66-73=139' | wikisql |
CREATE TABLE table_23584 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | How many players were drafted from laval? | SELECT COUNT("CFL Team") FROM table_23584 WHERE "College" = 'Laval' | wikisql |
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,
... | 从12.3.26开始,截止到18.10.14,在患者78964308开出的所有药品里,自付比例低于0.65的总共有多少 | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '78964308' AND t_kc22.STA_DATE BETWEEN '2012-03-26' AND '2018-10-14' AND t_kc22.SELF_PAY_PRO < 0.65 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb... | css |
CREATE TABLE table_65778 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Bronze has a Rank of 4, and a Gold smaller than 0? | SELECT MAX("Bronze") FROM table_65778 WHERE "Rank" = '4' AND "Gold" < '0' | wikisql |
CREATE TABLE table_10732 (
"Number Range" text,
"Introduced" text,
"Builder" text,
"Engine" text,
"Seats" text,
"Withdrawn" text
) | What engine was introduced in 1935? | SELECT "Engine" FROM table_10732 WHERE "Introduced" = '1935' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | count how many patients have been discharged from hospital. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_74762 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home team score for Footscray? | SELECT "Home team score" FROM table_74762 WHERE "Home team" = 'footscray' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewRejectionReasons (
Id number,
N... | Users with at least X reputation. | SELECT COUNT(*) FROM Users WHERE Reputation >= '##X?30000##' | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | Calculate the average age of patients who had an emergency type hospital admission and suffered from bladder cancer/sda as their primary disease. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "BLADDER CANCER/SDA" | mimicsql_data |
CREATE TABLE ref_locations (
location_code text,
location_name text,
location_description text
)
CREATE TABLE employees (
employee_id number,
role_code text,
employee_name text,
gender_mfu text,
date_of_birth time,
other_details text
)
CREATE TABLE documents_to_be_destroyed (
d... | Show the location codes with at least 3 documents. | SELECT location_code FROM document_locations GROUP BY location_code HAVING COUNT(*) >= 3 | spider |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 请把患者陶浩阔在二零零八年十二月十一日到二零一七年十月十日内所有检验结果指标记录中的仪器编号以及名称都找出来 | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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_MZJZ... | css |
CREATE TABLE table_26769_1 (
capital VARCHAR,
population_density_per_km² VARCHAR
) | What is the capital of the country with a population density per km of 15.6/km (/sqmi)? | SELECT capital FROM table_26769_1 WHERE population_density_per_km² = "15.6/km² (/sqmi)" | sql_create_context |
CREATE TABLE table_name_99 (
date VARCHAR,
label VARCHAR,
format VARCHAR
) | What date had a 4ad label and a CD (reissue) format? | SELECT date FROM table_name_99 WHERE label = "4ad" AND format = "cd (reissue)" | sql_create_context |
CREATE TABLE table_2416 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Midshipmen points" real,
"Opponents" real,
"Record" text
) | Name the result for 9-1 record | SELECT "Result" FROM table_2416 WHERE "Record" = '9-1' | wikisql |
CREATE TABLE table_640 (
"Episode #" real,
"Title" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Part 5" text,
"Part 6" text
) | When did the part 1 of the episode 'Anxiety' air? | SELECT "Part 1" FROM table_640 WHERE "Title" = 'Anxiety' | wikisql |
CREATE TABLE table_31917 (
"Pick #" real,
"MLS team" text,
"Player" text,
"Position" text,
"Affiliation" text
) | Chicago fire has a total of a total of how many #s? | SELECT COUNT("Pick #") FROM table_31917 WHERE "MLS team" = 'chicago fire' | wikisql |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | all fares and flights from PHILADELPHIA | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'PHILADELPHIA' AND flight.from_airport = airport_service.airport_code | atis |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amenity (
amenid ... | what is the average age for each dorm and what are the names of each dorm?, list by the total number in asc. | SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY AVG(T1.Age) | nvbench |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Show sum team id from each all home, sort bars from low to high order please. | SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home | nvbench |
CREATE TABLE table_62152 (
"Pick #" real,
"Player" text,
"Nationality" text,
"Position" text,
"NHL team" text,
"Team from" text,
"League from" text
) | Name the Nationality of s dert lje sk? | SELECT "Nationality" FROM table_62152 WHERE "Team from" = 'södertälje sk' | wikisql |
CREATE TABLE table_name_24 (
attendance INTEGER,
record VARCHAR,
average VARCHAR
) | What's the mean attendance number when the record is 12-4 and the average is less than 10,027? | SELECT AVG(attendance) FROM table_name_24 WHERE record = "12-4" AND average < 10 OFFSET 027 | sql_create_context |
CREATE TABLE table_name_5 (
season_1 VARCHAR,
season_7 VARCHAR
) | Which Season 1 has a Season 7 of david chilton? | SELECT season_1 FROM table_name_5 WHERE season_7 = "david chilton" | 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... | count the number of patients whose year of birth is less than 2065 and procedure short title is skin closure nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2065" AND procedures.short_title = "Skin closure NEC" | mimicsql_data |
CREATE TABLE table_204_627 (
id number,
"date" text,
"opponent" text,
"score" text,
"top scorer (total points)" text,
"venue (location)" text
) | in how many games did this team have more than 80 points ? | SELECT COUNT(*) FROM table_204_627 WHERE "score" > 80 | squall |
CREATE TABLE table_204_162 (
id number,
"team" text,
"constructor" text,
"motorcycle" text,
"tyres" text,
"no" number,
"rider" text,
"rounds" text
) | are the riders of the camel yamaha team the same as tech 3 yamaha ? | SELECT (SELECT "rider" FROM table_204_162 WHERE "team" = 'camel yamaha team') = (SELECT "rider" FROM table_204_162 WHERE "team" = 'tech 3 yamaha') | squall |
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,... | give me the number of emergency hospital admission patients who had initial insertion of tranvenous lead [electrode] into ventricle. | 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.short_title = "Int insert lead in vent" | mimicsql_data |
CREATE TABLE table_47275 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | WHAT IS THE 2012 PERFORMANCE FOR THE MADRID MASTERS? | SELECT "2012" FROM table_47275 WHERE "Tournament" = 'madrid masters' | wikisql |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | Give me the number of patients less than 62 years who are suffering from morbid obesity/sda as their primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND demographic.age < "62" | mimicsql_data |
CREATE TABLE table_name_96 (
rank VARCHAR,
final VARCHAR
) | Which rank has final with 5:18.85? | SELECT rank FROM table_name_96 WHERE final = "5:18.85" | sql_create_context |
CREATE TABLE table_10706879_3 (
name VARCHAR,
winning_driver VARCHAR
) | What are the races that johnny rutherford has won? | SELECT name FROM table_10706879_3 WHERE winning_driver = "Johnny Rutherford" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | provide the number of patients whose admission location is trsf within this facility and lab test name is cholesterol, ldl, calculated? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.label = "Cholesterol, LDL, Calculated" | mimicsql_data |
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,... | what is primary disease and diagnoses icd9 code of subject id 84129? | SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "84129" | mimicsql_data |
CREATE TABLE table_58953 (
"Year" real,
"Stage" real,
"Category" real,
"Start" text,
"Finish" text,
"Leader at the summit" text
) | What is the category for the year when Brioude started and the stage is less than 7? | SELECT COUNT("Category") FROM table_58953 WHERE "Start" = 'brioude' AND "Stage" < '7' | wikisql |
CREATE TABLE table_name_34 (
label VARCHAR,
region VARCHAR,
date VARCHAR
) | What is the label for the UK in 1996? | SELECT label FROM table_name_34 WHERE region = "uk" AND date = "1996" | sql_create_context |
CREATE TABLE table_204_250 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text,
"attendance" number
) | which month is listed the least on this chart ? | SELECT "date" FROM table_204_250 GROUP BY "date" ORDER BY COUNT(*) LIMIT 1 | squall |
CREATE TABLE table_9745 (
"Tournament" text,
"1985" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2010" text,... | What is the value in 1987 when it is A in 1999, 1989, and 1997? | SELECT "1987" FROM table_9745 WHERE "1999" = 'a' AND "1989" = 'a' AND "1997" = 'a' | wikisql |
CREATE TABLE table_204_35 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
) | what is the number of times that they placed 1st ? | SELECT COUNT(*) FROM table_204_35 WHERE "place" = 1 | squall |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TI... | Compare the average salary by each hire date (bin it into the day of week interval) of employees using a bar chart. | SELECT HIRE_DATE, AVG(SALARY) FROM employees | nvbench |
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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE... | what is the number of patients diagnosed with lack of coordination until 2102? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'lack of coordination') AND STRFTIME('%y', diagnoses_icd.ch... | mimic_iii |
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... | Posts containing a given text (case insensitive, including title). | SELECT Id AS "post_link", OwnerUserId AS "user_link", CreationDate, LastActivityDate, Score, ViewCount, Body FROM Posts WHERE (CONCAT(LOWER(Title), ' ', LOWER(Body)) LIKE '%##text?analisi##%') ORDER BY CreationDate DESC LIMIT 500 | sede |
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 was hired before 2002-06-21, visualize a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, and show by the Y-axis from high to low. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_62391 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
) | What is the sum of Goals scored when there was less than 20 Games played? | SELECT SUM("Goals scored") FROM table_62391 WHERE "Games played" < '20' | wikisql |
CREATE TABLE table_36595 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | What nationality is Rob Nicholson? | SELECT "Nationality" FROM table_36595 WHERE "Player" = 'rob nicholson' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | Search my answer posts by tag.... | SELECT Answer.Id AS "post_link", Answer.Score AS "score", Answer.CreationDate AS "creation_date" FROM Posts AS Question LEFT JOIN Posts AS Answer ON Question.Id = Answer.ParentId WHERE Answer.OwnerUserId = @MyUserID AND Answer.PostTypeId IN (2, 3) AND NOT Question.Tags LIKE '%' + @Tag + '%' AND UPPER(Question.Body) LIK... | sede |
CREATE TABLE table_203_266 (
id number,
"group" text,
"members" number,
"caucusing" number,
"total" number
) | what is the total amount of members in the socialist group not including caucusing members ? | SELECT "members" FROM table_203_266 WHERE "group" = 'socialist group' | squall |
CREATE TABLE table_26485957_1 (
artist VARCHAR,
result VARCHAR
) | Which artist had a result of 4? | SELECT artist FROM table_26485957_1 WHERE result = "4" | sql_create_context |
CREATE TABLE table_name_48 (
played INTEGER,
first_game VARCHAR,
drawn VARCHAR
) | What is the average number of games played associated with a first game in 1997 and over 0 games drawn? | SELECT AVG(played) FROM table_name_48 WHERE first_game = 1997 AND drawn > 0 | sql_create_context |
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,
... | 科室83252的药品913590-q的开药量情况,从06年7月24日到08年6月6日内有多少? | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.MED_ORG_DEPT_CD = '83252' AND t_kc22.STA_DATE BETWEEN '2006-07-24' AND '2008-06-06' AND t_kc22.SOC_SRT_DIRE_CD = '913590-q' | css |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId numb... | Where a specific tag was added by the given user. | WITH firstrev_cte AS (SELECT MIN(ph.Id) AS MinId, p.Id FROM Posts AS p JOIN PostHistory AS ph ON ph.PostId = p.Id WHERE ph.Text LIKE '%<##tagName?divergence-operator##>%' AND ph.PostHistoryTypeId IN (3, 6, 9) GROUP BY p.Id) SELECT ph.PostId AS "post_link", 'site://posts/' + CAST(ph.PostId AS TEXT) + '/revisions' AS "re... | sede |
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 headquarter , and group by attribute headquarter by a bar chart, and show in desc by the x-axis. | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter DESC | nvbench |
CREATE TABLE table_name_65 (
crowd INTEGER,
venue VARCHAR
) | What was the sum of the crowds at Western Oval? | SELECT SUM(crowd) FROM table_name_65 WHERE venue = "western oval" | sql_create_context |
CREATE TABLE table_11630008_6 (
original_air_date VARCHAR,
production_code VARCHAR
) | When did the episode with production code 410 air? | SELECT original_air_date FROM table_11630008_6 WHERE production_code = 410 | sql_create_context |
CREATE TABLE table_name_90 (
year VARCHAR,
award VARCHAR
) | How many times was the award inte awards? | SELECT COUNT(year) FROM table_name_90 WHERE award = "inte awards" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.