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;
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;
Table_First |
Table_Second |
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:
ANSWER 1:
ANSWER 2:
ANSWER 3:
ANSWER 4:
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.
very nice sunil
ReplyDeleteVery useful information thank you for sharing. Know more about Oracle SQL Training
ReplyDeleteThanks for sharing..really helpful stuff!
ReplyDelete
ReplyDeleteThanks for sharing this interview question it has helped me a lot.
Best oracle sql training course in bangalore
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