SQL RIGHT JOIN Keyword

select * from employeeinfo;

name age address dob
Komal 25 Mumbai 1997-10-19
Ramesh 35 Delhi 1995-08-29
Kaushik 31 Indore 1991-05-05
Hardik 22 Hyderabad 1998-01-25
Glory 28 Kanpur 1990-12-15
Akshaya 29 Delhi 1985-01-28
 select * from employeedep;
name id department
Komal I010 Dev
Akshaya I016 Dev
Ramesh I026 Quality
Hardik I038 Ops
Kaushik I046 Quality
Glory I058 Ops

RIGHT JOIN Keyword:

SELECT employeedep.id, employeeinfo.name, employeedep.department from employeedep RIGHT JOIN employeeinfo ON employeeinfo.name = employeedep.name;

id name department
I010 Komal Dev
I026 Ramesh Quality
I046 Kaushik Quality
I038 Hardik Ops
I058 Glory Ops
I016 Akshaya Dev

Leave a Reply

Your email address will not be published. Required fields are marked *