What are the differences between UNION and JOINS?

Answers were Sorted based on User's Feedback



What are the differences between UNION and JOINS?..

Answer / saravakumar

A join selects columns from 2 or more tables. A union
selects rows.

Is This Answer Correct ?    7 Yes 0 No

What are the differences between UNION and JOINS?..

Answer / sree

UNION:The SQL UNION operator combines two or more SELECT
statements.

JOINS:SQL joins are used to query data from two or more
tables, based on a relationship between certain columns in
these tables.

Is This Answer Correct ?    4 Yes 0 No

What are the differences between UNION and JOINS?..

Answer / nikhila reddy

UNION:the both tables should have same structure and datatype.
the column name will taken as first table ones it wont bother abt other tables.
example:
emp table as
eid ename esal
1 a 10k
2 b 20k

dept table as
deptid deptname deptsal
11 aa 20k
12 bb 50k


select * from emp
union
select * from dept

empid empname empsal
1 a 10k
2 b 20k
11 aa 20k
12 bb 50k

now u can observe col name taking alias of first table.
no need of relation between a tables.
it will remove duplicate records.


joins:it will join only required fields from different tables.
no need of same structure for tables..
it should have relation between a tables.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

I have cleared sbi clerk examination. I am Bachelor in computer application (BCA) graduate. so which type of question related bca in sbi clerk interviews. pls answers me at sejalvaghela@yahoo.co.in.. and also tell me which type of question asked in sbi clerk interview.

1 Answers  


Which feature in sql server 2008 has surprised you? You can name just one. : sql server database administration

0 Answers  


What is the distinction amongst delete and truncate?

0 Answers  


Differentiate between truncate vs delete in mssql?

0 Answers  


Why we need sql server?

0 Answers  






What is bit datatype and what's the information that can be stored inside a bit column?

1 Answers  


What is an inner join?

0 Answers  


What about UPDATESTATISTICS ?

2 Answers   HCL, Intelligroup,


Explain collation?

0 Answers  


Do you know what are the ways available in sql server to execute sql statements?

0 Answers  


Can we drop user if user mapped to any logins

1 Answers  


How to compose an inquiry to demonstrate the points of interest of an understudy from students table whose name begins with k?

0 Answers  


Categories