0% found this document useful (0 votes)
39 views

SQL Join

This document discusses different types of joins in SQL including inner joins, outer joins, left joins, right joins, full joins, and self joins. It provides examples of SQL queries using joins between two tables named t1 and t2 to select columns and return rows where the IDs match between the tables.

Uploaded by

Faizul Raza
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

SQL Join

This document discusses different types of joins in SQL including inner joins, outer joins, left joins, right joins, full joins, and self joins. It provides examples of SQL queries using joins between two tables named t1 and t2 to select columns and return rows where the IDs match between the tables.

Uploaded by

Faizul Raza
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 3

t1

id

name
1a
2b
3c

cross join
inner join
outer join left
right
full
self join

select * from t1,t2

select m.ename,E.ENAME FRom emp e join emp m on m.empno=e.mgr

t2
id

name
2d
4e
5f

insert into t2 values(5,'f')


select * from t1
select * from t2

p m on m.empno=e.mgr
select * from t1,t2
select * from t1 join t2 on t1.id=t2.id

select * from t1 full outer join t2 on t1.id=t2.i

on t1.id=t2.id

er join t2 on t1.id=t2.id

You might also like