*******IMPORTANT*********
1. I wanted to mention this in the video itself, but it just slipped my mind. An even better way is to use group by with department id and employee id and not employee name, since in case of several persons having same name and department, this would pose a problem. So better still if you rephrase your query as
"select d.name as Department, e.name as Employee, e.salary as Salary from Department d, Employee e, Employee e2
where d.id = e.departmentId and e.departmentId = e2.departmentId and
e.salary greater than equal to (please replace this with the proper symbol, YT didn't allow me to use it here) e2.salary group by d.id, e.id having ..." (finish the query as shown in video)
2. If you do not use the salary comparison operator in the "where" clause, the count value will be four for IT employees and 2 for Sales Employees, I did not specifically mention in the video, so made the point here, if that confuses some of you.
3. LINK TO THE SQL HANDS-ON VIDEO (for a detailed understanding)
• SQL - MUST KNOW STATEMENTS (Hands on Tutor...