0% found this document useful (0 votes)
0 views3 pages

Assignment3 Python

The document contains SQL queries demonstrating various types of joins between employee and department tables, including inner join, left outer join, cross join, self-join, and full outer join. Each section provides a query followed by a placeholder for output. The document is structured as an assignment by a student named Martin Patel.

Uploaded by

gamopatel671
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views3 pages

Assignment3 Python

The document contains SQL queries demonstrating various types of joins between employee and department tables, including inner join, left outer join, cross join, self-join, and full outer join. Each section provides a query followed by a placeholder for output. The document is structured as an assignment by a student named Martin Patel.

Uploaded by

gamopatel671
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

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

You might also like