What is UNION ALL in SQL?

A union is used for extracting rows using the conditions specified in the query while Union All is used for extracting all the rows from a set of two tables.

Syntax –

query1 UNION ALL query2

The same conditions are applicable to Union All as that of Union. The only difference between Union and Union All is that Union extracts the rows that are being specified in the query while Union All extracts all the rows including the duplicates (repeated values) from both the queries.