Optimize Outer Join queries is a powerful tool for retrieving data from multiple tables. However, if not used judiciously, they…