Home »
MCQs »
SQL MCQs »
SQL SET Operators MCQs
What is the difference between UNION & UNION ALL operators?
8. What is the difference between UNION & UNION ALL operators?
- Combining the results of two select statements will be done using UNION whereas combined records from both queries are returned by UNION ALL operator.
- Combining the results of two select statements will be done using UNION ALL whereas combined records from both queries are returned by UNION operator.
- After performing the UNION operation, duplicate rows will not be removed whereas after performing the UNION ALL operation, duplicate rows will be removed.
- None of the above
Answer: A) Combining the results of two select statements will be done using UNION whereas combined records from both queries are returned by UNION ALL operator
Explanation:
Difference between UNION & UNION ALL operators is –
- Combining the results of two select statements will be done using UNION whereas combined records from both queries are returned by UNION ALL operator.
- After performing the UNION ALL operation, duplicate rows will not be removed whereas after performing the UNION operation, duplicate rows will be removed.