About the condition with the same amount of columns in the tables: what if we only choose 2 columns per table to union but the original tables don’t have the same amount of columns, will it work?
let’s say the table newspaper has 5 columns and the table subscription has 3. if i only pick 2 per table for the union is that possible?
like:
select id, first_name
from newspaper
union
select id, start_month
from subscription;
Can someone please clarify for me the following: Are all of the queries in this exercise just that “queries” or do some actually change the tables, columns or data? Such as cross join or union, etc…
This might be a stupid question but why is it that when we JOIN two tables it is sufficient to simply SELECT * to display the resultant joined table, like so:
SELECT *
FROM table1
INNER JOIN table 2
However for a union, the method changes such that we have to specify SELECT * twice, like this:
SELECT *
FROM table1
UNION
SELECT *
FROM table2
If SELECT can be used to display the resultant joined table, why can it be used similarly like so:
What is the difference between Union and Cross Join? They both look the same to me but they were introduced as different things so I know they are not supposed to be the same.