explain different types of jions with examples briefly?
Answers were Sorted based on User's Feedback
Answer / vijay
The SQL join command is used to join two or more tables. At
times you may need to join two or more tables to retrieve
the information you need from your SQL database
Types Of Joins-
1.Inner Join
2.Outer Join -types -
left Outer,
Right Outer,
Full Join
3.Cross Join
4.Self Join
| Is This Answer Correct ? | 13 Yes | 2 No |
Answer / ramesh
Basically Joins are used to get result from two or more
tables and there are two types of joins
inner join and outer join
Inner join : a join of two or more tables which omits the
blank rows while checking
Outer join is subcatogorised in to left outer join and right
outer join. Which includes blank rows in specifed side if
condition satisfies.
Simple outer join is combination of left and right outerjoins.
Apart from these there are
Natural join : cartisian product
Equi join : which includes = operator in condition
NonEqui join : All conditional joins which doesn't uses = in
there conditions.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / dinesh .
16)Join
Table1:Record
1 a
2 b
3 b
4 b
4 c
Table2:Record1
1 a 2
2 b 2
3 c 24
5 f 2
8 g 2
10 j NULL
Inner Join:
Qry1:select record_name,recordcount from record inner join
record1 on
record.record_id=record1.record_code
Result:
a 2
b 2
b 24
qry2:select p.record_name,q.recordcount from record p,
record1 q where p.record_id=q.record_code
Result:
a 2
b 2
b 24
Left Join
qry3:select record_name,recordcount from record left join
record1 on
record.record_id=record1.record_code
Result:
a 2
b 2
b 24
b NULL
c NULL
Right Join
qry4:select record_name,recordcount from record right join
record1 on
record.record_id=record1.record_code
Result:
a 2
b 2
b 24
NULL 2
NULL 2
NULL NULL
Left Outer Join
qry5:select record_name,recordcount from record left outer
join record1 on
record.record_id=record1.record_code
Result:
a 2
b 2
b 24
b NULL
c NULL
Right Outer Join
qry6:select record_name,recordcount from record right outer
join record1 on
record.record_id=record1.record_code
Result:
a 2
b 2
b 24
NULL 2
NULL 2
NULL NULL
Full Outer Join
qry7:select record_name,recordcount from record full outer
join record1 on
record.record_id=record1.record_code
Result:
a 2
b 2
b 24
b NULL
c NULL
NULL 2
NULL 2
NULL NULL
"Their is No Left Inner Join,Right Inner Join in SQL Server
| Is This Answer Correct ? | 2 Yes | 1 No |
Issues related in upgrading SQL Server 2000 to 2005 / 2008
One table Test with single column. These are the values in the table a b c d e f g h I need a query (without using any variable) with output as - a b c d f f g h
What is the difference between executequery () and executeupdate ()?
is there a column to which a default can't be bound? : Sql server database administration
What is SQL Profiler what is the use of it?
2 Answers 247Customer, Steria,
Explain contrast amongst grouped and non-bunched records?
How to start and end transact-sql statements?
what is dbcc? : Sql server database administration
While using a cursor, how can you differentiate between a deleted row and a row that has been inserted with null data values?
Determine how to use the inserted and deleted pseudo tables?
What is blocking and how would you troubleshoot it? : sql server database administration
how to dispaly a particular row details from a given table
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)