3 ms·
cross joins create data (facts) that dont exist in real life you will probably never use them, except in rare cases for example return employee sales by produ
by systems 5y ago
cross joins create data (facts) that dont exist in real life
you will probably never use them, except in rare cases for example
return employee sales by products, show 0 if no sales
in a normal db, you will only have records for products with sales above 0
you will need a cross join to join every employee with all products even those with no sales
and full outer join will not work, because it will only return products with some sales for at least one employee
only a cross join will return all products
i will do this in two steps
1 cross join emp and product
left join the result from 1 to product sales
replace nulls with 0
rare case, stupid case too