Do the tables have to have the same number of columns when combining them?

Question

In the context of this exercise, do tables have to have the same number of columns when combining them?

Answer

Yes, when combining two tables using a UNION, they must have the same number of columns. The columns do not need to have the same name, because they are combined based on column positions rather than the column names. However, they should have similar data types.

9 Likes