BOX8 | SQL Query

Question

Assume the name of table and columns
There are two tables with a common column. Which one will take more processing time
-Outer Join
– Full Outer Join
– Cartesian Join

in progress 1
TheDataMonk 55 years 4 Answers 1624 views Grand Master 2

Answers ( 4 )

  1. In my perspective cartesian join should take maximum processing time
    as it always multiplies the no of rows in both the tables to get the final output.
    Suppose, table 1 has 10 rows and table 2 has 20 rows, with 5 rows common.
    Cartesian join will give 10*20 = 200 rows.
    Full outer join will give (10 + 20 – 5) = 25 rows(Left outer + Right Outer – inner).
    Left outer join will give 10 and Right Outer will give 20 rows.
    This is a scenario when you are generally matching on some columns which
    are acting as primary key or have unique values.
    If all the values in the columns which you are matching are same, then probably,they
    would all take the same time as they would produce the same output.

  2. Cartesian Join as it is a cross product

  3. Cartesian Join will take more time , it is a cross product of two columns.

Leave an answer

Browse
Browse