I have no previous experience of SQL but I just now have an assignment where I'm supposed to join 2 tables using different kinds of joins (on physical paper, not in an editor).
Table 1 is called Cities and has 2 columns, Cities and Countries. Table 2 is called Countries and has 2 columns, Countries and Currency.
The key is Cities.Countries > Countries.Countries
So, the joins are easy enough to understand, my question is more about the order in the output table and what columns are shown (been watching tons of tutorials but I can't grip these two details).
This is the first command:
SELECT Cities.*, Countries.* FROM Cities INNER JOIN Countries ON Cities.Countries = Countries.Countries
I'm wondering two things,
SELECT Cities.*, Countries.*part mean that the output will show ALL 4 columns and thus 2 columns with identical values, or will KeyA and KeyB be merged into only one column?
If I got several "Italy" for example in the Countries column of the Cities table (different cities), but the are not right after each other in the table, will the output order them so that all Italy values come adjacent or just go with the order from the original table?
Very basic questions I'm sure but I don't have access to a simulator of any kind! :)
Thanks in advance!