I think there is a mistake at 5:06 where in the select clause you have mentioned e2.sal which is managers salary... Instead of e1.sal That is 2975 is the manager (jones) salary. Which is less than scott's and Ford's salary.
here all the 7 employees and their managers' name can be displayed through the query:select a.ename,b.ename as mgrname from emp a left join emp b on a.mgrid=b.empid
The point of this video is why there is a self join. Not finding out the most optimal way to get what is needed. So my point is your comment is useless.
AT 5:06 you said the salary of scot and ford is 2975 but it is Jones salary and the salary of scot and ford is 3000, then the employee scot and ford having a salary of 3000 which is greater than the manager jones. So, please check it.
I think there is a mistake at 5:06 where in the select clause you have mentioned e2.sal which is managers salary... Instead of e1.sal
That is 2975 is the manager (jones) salary. Which is less than scott's and Ford's salary.
Must be typo there he must add e1.sal for employee salary and check for manager salary. Same issue with hiredate
Another example we can consider as "select employee name and employee id who are having atleast 2 employees directly reporting to them"
This was asked to me in recent interview, I could not answer this and I failed
@@aakashjadhav6242 select ename
from (select ename, count(*) over (partition by mgr) cnt from emp order by cnt)
where cnt >2;
👏🏻👏🏻👏🏻👏🏻👏🏻very nice explanation....
Yes he has printed the salary and hiredate of manager not the employees he might said wrongly cz e2.sal and e2.hiredate
here all the 7 employees and their managers' name can be displayed through the query:select a.ename,b.ename as mgrname from emp a left join emp b on a.mgrid=b.empid
The point of this video is why there is a self join. Not finding out the most optimal way to get what is needed. So my point is your comment is useless.
Thanks for the video...
Explaining good PLEASE SLOOOOOOW SLOOOW DOWN TALKING DUDE
You can adjust play back speed
AT 5:06 you said the salary of scot and ford is 2975 but it is Jones salary and the salary of scot and ford is 3000, then the employee scot and ford having a salary of 3000 which is greater than the manager jones. So, please check it.
Yes he has printed the salary and hiredate of manager not the employees he might said wrongly cz e2.sal and e2.hiredate
thanks bro
Confusing
Because he didn't explain briefly
You are using WHERE clause, and you caption the video as SELF JOIN??
Jatav bhai ye self join hi hai
can we have e1.sal inplace of e2.sal in this explanation
Display country name,city,and number of departments where department has more than 5employees
use group by with having clause
This question is from hr schema
Video is blurry
this is the best explanation for self join I have ever seen