What is the difference between CROSS JOIN and INNER JOIN?
CROSS JOIN:
SELECT
Movies.CustomerID, Movie
A = {1,5,3,4,6,7,9,8} B = {2,8,5,4,3,6,9}
cross join act as Cartesian product A ✖ B = {1,2}, {1,8}...,{5,2}, {5,8},{5,5}.....{3,3}...,{6,6}....{8,9} and returned this long result set..
when processing inner join its done through Cartesian product and choose matching pairs.. if think this ordered pairs as
two table's primary keys and on clause search for A = B then inner join choose {5,5}, {4,4}, {6,6}, {9,9}
and returned asked column in select clause related to these id's.
if cross join on a = b then it's result same result set as inner join. in that case also use inner join.