Methods of join operation

1. Nested Loop Join: This method is the most basic and straightforward join operation. It involves comparing each row from one table with every row from the other table, resulting in a Cartesian product. The drawback of this method is its inefficiency, especially when dealing with large tables.

2. Hash Join: Hash Join is an efficient join operation that uses hash functions to perform the join. It involves creating hash tables for both tables based on a common join attribute. The join is then performed by matching the hash values and combining the matching rows. This method is especially efficient when dealing with large tables.

3. Sort-Merge Join: Sort-Merge Join involves sorting both tables based on the join attribute and then merging the sorted tables by comparing the join attribute values. This method is efficient when dealing with large tables and works well if both tables are pre-sorted.

4. Index Join: Index Join utilizes indexes on the join attribute to perform the join operation. It involves retrieving matching rows from both tables using their respective indexes and combining the results. This method is efficient when dealing with large tables that have appropriate indexes.

5. Cartesian Product: Although not recommended for joining large tables due to its inefficiency, Cartesian Product involves combining all rows from one table with all rows from the other table. This method can be used in certain scenarios where a cross join is required.