really helping me study, thank you for all the clear explanations!
@shivambaghel96682 жыл бұрын
you deserves more likes and subscribes
@rudrapriyan51628 ай бұрын
Do you think if we EXISTS it would reduce the time complexity or the number of tuples it has to olerate on ?
@vgaurav30114 жыл бұрын
Nice explanation, loved it!
@VedPrakashLearnToGrow3 жыл бұрын
Awesome Explanation, Thank you
@zeeshanali2712 жыл бұрын
I still don't understand the ON clause position statement
@rachcastellino4 жыл бұрын
when you are matching on managerID and ID, why does it pair together ID's that aren't the same value? is this supposed to create all combinations of employees?
@frederikmuller4 жыл бұрын
the join takes the ManagerId of a row and looks for a matching (regular) Id. it seems like you mixed up ManagerId and Id. take a look at the output at 4:21 to see how the 4th and 5th column always match. managers also have a regular Id which can't match the regular Id of another employee since these Ids are unique. hope this helps :)
@angelalu38552 жыл бұрын
very useful! thanks a lot!
@yueleji88923 жыл бұрын
could you explain the difference between using ' on and' and 'where' in left join? for example leetcode 577? Thank you!
@frederikmuller3 жыл бұрын
good idea for an upcoming video!
@semantosaini96003 жыл бұрын
why in the on clause it is e1.managerid=e2.id and not e1.id=e2.managerid?
@vinoddiwan57922 жыл бұрын
because from e1 table first we need to find if its manager exists or not . If exists then match from main table e.i id . So, e1.manager id id the foreign key because we need to first find if it exists in other table or not.
@ThereIsPowerInTheBloodOfJesus7 Жыл бұрын
Is this still in SQL?
@TheProximator3 жыл бұрын
Nice, thanks a lot :)
@frederikmuller3 жыл бұрын
You're welcome!
@mickyman7532 жыл бұрын
I wrote it like this , don't know why that join doesn't click when I'm doing problems , although I'm doing the same thing select e1.name as Employee from Employee e1 where e1.salary>(select e2.salary from Employee e2 where e2.id=e1.ManagerId);
@avahome52853 жыл бұрын
self join to get the employee's salary and the manager's salary in a row.
@mritunzaysingh89782 жыл бұрын
create table employee (id int not null PRIMARY key, name varchar(20), salary int, managerid int ); insert into employee VALUES(1,'JOE',7000,3),(2,'MARRY',8000,4),(3,'SAM',6000,NULL),(4,'MAX',9000,NULL); select * from employee; select E.name,E.salary as emp_salary,M.salary as manager_salary from employee as E join employee as M on E.managerid = M.id where E.salary > M.salary; select E.name as emp_name from employee as E join employee as M on E.managerid = M.id where E.salary > M.salary;
@alibhaiacademy29813 жыл бұрын
Thanks, my solution SELECT name AS "Employee" FROM employee e WHERE managerid IN ( SELECT id FROM employee m WHERE e.salary > m.salary
@Games-hearty15 күн бұрын
Do you know what you're doing. You are getting Incorrect. My Favourite Python Teacher is Neetcode Io. But he doesn't upload any advanced videos. So I have no choice but to listen to you. But Anyways Good Work.
@frederikmuller15 күн бұрын
I‘m running partial solutions which is why they will often be marked as incorrect until the final submission.