๐ Day 6 โ Data Analyst Most Asked Interview Question โ
UNION vs UNION ALL (SQL)
โโโโโโโโโโโโโโ
UNION
โข Combines result sets
โข Removes duplicate rows
โข Slightly slower due to deduplication
โข Columns count & data types must match
UNION ALL
โข Combines result sets
โข Keeps duplicates
โข Faster than UNION
โข Columns count & data types must match
โโโโโโโโโโโโโโ
Rule:
๐ Duplicates should be removed โ UNION
๐ Performance matters & duplicates allowed โ UNION ALL โ
โโโโโโโโโโโโโโ
โค๏ธ React โค๏ธ if you want interview prep Day 7 Tomorrow ๐ฅ
Post #1963
2.07K
- โค 5