Martin Patel Roll NO:-55 DIV-1
ASSIGNMENT:3
1. Apply inner join on employee and department table.
QUERY: select *from employee e inner join department d on d.dept_id=e.dept_id;
OUTPUT:
2. Apply left outer join on department and employee table.
QUERY: select *from department d left join employee e on d.dept_id=e.dept_id;
OUTPUT:
3. Apply cross join on department and employee table.
QUERY: select * from employee CROSS JOIN department;
Page 1|3
Martin Patel Roll NO:-55 DIV-1
OUTPUT:
4. Apply self-join on employee table to fetch first_name and last_name of those
employees who are earning same salary.
QUERY: select e1.emp_id ,e1.first_name ,e2.last_name from employee e1 join employee
e2 on e1.salary = e2.salary AND e1.emp_id != e2.emp_id;
OUTPUT:
5. Apply full outer join on department and employee table.
OUERY: select * from employee FULL OUTER JOIN department;
Page 2|3
Martin Patel Roll NO:-55 DIV-1
OUTPUT:
Page 3|3