Pages

27 August 2016

SQL / ORACLE- Scenario Based Interview Questions & Answers PART- 10

   Consider below two tables Table_First and Table_Second for answering the below questions. Basically you will be able to check your JOIN concepts. Take your time and ponder over and then try answer questions. It is easy but very conceptual.


SELECT * FROM Table_First;
SELECT * FROM Table_Second;


SQL / ORACLE- Scenario Based Interview Questions & Answers PART- 10
Table_First
SQL / ORACLE- Scenario Based Interview Questions & Answers PART- 10
Table_Second

Take pen and paper and then try to solve SQL query.

Q1.What will be the ouput if we are doing INNER JOIN between the above two tables as follows:
SELECT X,Y
FROM Table_First F
INNER JOIN Table_Second S
ON F.X=S.Y;


Check answer at bottom of this post:

Q2.What will be the ouput if we are doing LEFT OUTER JOIN between the above two tables as follows:
SELECT X,Y
FROM Table_First F
LEFT OUTER JOIN Table_Second S
ON F.X=S.Y;

Check answer at bottom of this post:

Q3.What will be the ouput if we are doing RIGHT OUTER JOIN between the above two tables as follows:
SELECT X,Y
FROM Table_First F
RIGHT OUTER JOIN Table_Second S
ON F.X=S.Y;

Check answer at bottom of this post:

Q4.What will be the ouput if we are doing FULL OUTER JOIN between the above two tables as follows:
SELECT X,Y
FROM Table_First F
FULL OUTER JOIN Table_Second S
ON F.X=S.Y;

Check answer at bottom of this post:

ANSWERS:


ANSWER 1:


X
Y
9
9
9
9












ANSWER 2:


9
9
9
9
NULL
NULL
8
NULL











ANSWER 3:


9
9
9
9
NULL
NULL











ANSWER 4:




9
9
9
9
NULL
NULL
NULL
NULL
8
NULL











If you like this post, don't forget to share and post comment.


5 comments:

  1. Very useful information thank you for sharing. Know more about Oracle SQL Training

    ReplyDelete
  2. Thanks for sharing..really helpful stuff!

    ReplyDelete

  3. Thanks for sharing this interview question it has helped me a lot.
    Best oracle sql training course in bangalore

    ReplyDelete
  4. What an informative blog it was. It had such relevant and interesting points that actually enhanced my knowledge and cleared my doubts. Thankyou for this blog, it was very useful. Here is a referred link same as yours oracle fusion hcm training.

    ReplyDelete