This page demonstrates use of the cartesian product join and the inner join
The store manager wants the entire information from the two tables 'product' and 'inventory'.
Note : A Cartesian product join operation should be used with extreme caution when working with large tables as the amount of resources required to perform such a join operation can have a serious negative impact on performance.
Query the two tables using a Cartesian product join.
The result data set produced will contain all possible combinations of the rows found in each table specified. Every row in the result data set produced is a row from the first table referenced concatenated with a row from the second table referenced. The total number of rows found in the result data set produced is the product of the number of rows in all the individual table references
The store manager wants a comparison of selling price and cost price of those products whose listing is common to both the 'product' table as well as the 'inventory' table
Query the two tables using an inner join
The result data set contains a combination of rows from the two tables with common 'product_ID'. This join eliminates information that may be present in either tables but whose product_ID s are not a match. The above SQL returns the names of products available in the store for sale, excluding the in house products and the products in the 'inventory' table that are not in the product table, and their corresponding selling price and cost price