A UNION operation combines two sets of columns and removes duplicates. The UNION ALL expression does the same but does…