Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
michael1999
3y ago
0 comments
Share
How would that work? Your schema allows an employee to be assigned to multiple departments, and the query must count them.
0 comments
default
newest
oldest
atwebb
3y ago
It is also called Table Elimination if you want a google-able term.
jmalicki
3y ago
Because of the foreign key, the query should reduce to "explain select count(*) from Department d;"
1 more reply
doctor_eval
3y ago
The schema only allows one employee per department, so there is no need to look up the employee table.
j
/
k
navigate · click thread line to collapse