3 ms·
How would that work? Your schema allows an employee to be assigned to multiple departments, and the query must count them.
by michael1999 4y ago
How would that work? Your schema allows an employee to be assigned to multiple departments, and the query must count them.
- doctor_eval 4y agoThe schema only allows one employee per department, so there is no need to look up the employee table.
- jmalicki 4y agoBecause of the foreign key, the query should reduce to "explain select count(*) from Department d;"
- deleted 4y ago[deleted]
- atwebb 4y agoIt is also called Table Elimination if you want a google-able term.