Find number of rows in output

Question

Table A

ColX
1
1

Table B

ColY
1
1
1
1
1

What will be the count of rows when: (for Table A and Table B)

  1. left join
  2. right join
  3. inner join
  4. cross join
  5. full outer join
in progress 0
psquare97 55 years 0 Answers 917 views Newbie 0

Answers ( No )

  1. 1. For Left Join, so according to the definition of the left join is that it will return all record form the left table & matched record from the Right table. The count of rows in Left Join is 2.
    2. For Right join, so according to the definition of the right join is that it will return all record from the right table & matched record from the Left Table. The count of rows in Right Join is 5.
    3. For inner join, so according to the definition it will return all the records that have matched in both the sides. The count of rows in Inner Join is also 2.
    4. For Cross Join it creates all paired combinations of the rows of the table that will be joined i.e., M*N ( Considering that M & N are rows of the given tables ). The count of rows in Cross Join is 10.
    5. For Full outer join, so according to the definition it will return the records when there is a match in either in Left or Right Table. So the count of rows in Full Outer Join is 5.

  2. Inner join , Left Outer Join Right outer join, Full Outer join will have same result as:
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1

  3. Inner join , Left Outer Join Right outer join, Full Outer join will have same result as:
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1

  4. Inner join , Left Outer Join Right outer join, Full Outer join will have same result as:
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1
    1,1

Leave an answer

Browse
Browse