What is the difference between join and union.

Answer Posted / lalitha

join:

The SQL JOIN clause is used whenever we have to select data
from 2 or more tables.
To be able to use SQL JOIN clause to extract data from 2
(or more) tables, we need a relationship between certain
columns in these tables.

union:

The purpose of the SQL UNION command is to combine the
results of two queries together. In this respect, UNION is
somewhat similar to JOIN in that they are both used to
related information from multiple tables. One restriction
of UNION is that all corresponding columns need to be of
the same data type. Also, when using UNION, only distinct
values are selected (similar to SELECT DISTINCT).

Is This Answer Correct ?    35 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does trigger mean in psychology?

514


Are subqueries better than joins?

503


Is it possible to read/write files to-and-from PL/SQL?

634


What is the difference between the implicit and explicit cursors?

505


what is “go” in t-sql? : Transact sql

573






What is an ndf file?

502


What are system versioned tables?

528


Why do we use view in sql?

510


What is integrity in sql?

532


what is a view? : Sql dba

608


what is the syntax used for partition in tsql? : Transact sql

514


how to rename an existing column in a table? : Sql dba

490


Inline the values in PL/SQL, what does it mean.?

609


What does the acronym acid stand for in database management?

511


Can you load data into multiple tables at once? : aql loader

571