mySQL foreign key and primary key Consider table A with columns id (primary key), name and table B with columns id, a_id (foreign key linked with table A id column), address. What will be the sequence of columns if the query is:
SELECT * FROM B INNER JOIN A ON B.a_id = A.id;
tables are unsorted by nature
so also the joined tables are unsorted
order them if you need it like you want.
So the columns are more complicated and more nested they become more complicated it gets.
Here are all possibilities  with two tables
the result differs, if you use ON Clause or the USING clause
In the USING clause, only RIGHT JOIN gives you another result


CREATE TABLE t1 (i INT, j INT);
CREATE TABLE t2 (k INT, j INT);
INSERT INTO t1 VALUES(1, 1);
INSERT INTO t2 VALUES(1, 1);






SELECT * FROM t1 NATURAL JOIN t2;


 j |  i |  k
-: | -: | -:
 1 |  1 |  1




SELECT * FROM t1 INNER JOIN t2 USING (j);


 j |  i |  k
-: | -: | -:
 1 |  1 |  1




SELECT * FROM t1 JOIN t2 USING (j);


 j |  i |  k
-: | -: | -:
 1 |  1 |  1




SELECT * FROM t1 LEFT JOIN t2 USING (j);


 j |  i |  k
-: | -: | -:
 1 |  1 |  1




SELECT * FROM t1 RiGHT JOIN t2 USING (j);


 j |  k |  i
-: | -: | -:
 1 |  1 |  1




SELECT * FROM t1 LEFT JOIN t2 ON (t1.j = t2.j);


 i |  j |  k |  j
-: | -: | -: | -:
 1 |  1 |  1 |  1




SELECT * FROM t1 RIGHT JOIN t2 ON (t1.j = t2.j);


 i |  j |  k |  j
-: | -: | -: | -:
 1 |  1 |  1 |  1




SELECT * FROM t1 INNER JOIN t2 ON (t1.j = t2.j);


 i |  j |  k |  j
-: | -: | -: | -:
 1 |  1 |  1 |  1


db&lt;&gt;fiddle here