SQL Questions and Answers – SQL Right Join

This set of SQL Multiple Choice Questions & Answers (MCQs) focuses on “SQL Right Join”.

1. Table1 RIGHT JOIN Table2 returns _____
a) All the records from Table2 and matched records from Table1
b) Records with matching values in both tables
c) All the records from Table1 and matched records from Table2
d) All records when there is a match in either Table1 or Table2
View Answer

Answer: a
Explanation: The RIGHT JOIN keyword returns all the records from the right table and the matched records from the left table.

2. If no match exists on the left side of RIGHT JOIN, the result-set will contain ____
a) Blank
b) Zero
c) Null
d) Random value
View Answer

Answer: c
Explanation: The rows for which there is no matching row on the left side table of RIGHT JOIN, the result-set will contain null.

3. Which of the following sets represents table1 RIGHT JOIN table2?
a) Table1 U Table2
b) Table1
c) Table2
d) Table1 ∩ Table2
View Answer

Answer: c
Explanation: RIGHT JOIN returns all the records from the table2 irrespective of the matching condition(s) and the matched records from the table1.
advertisement
advertisement

4. Instead of RIGHT JOIN, which of the following can be used to produce same result?
a) Inner join
b) Right inner join
c) Right outer join
d) Join
View Answer

Answer: c
Explanation: RIGHT JOIN returns all records from the right table, and the matched records from the left table. We can use RIGHT OUTER JOIN instead of RIGHT JOIN; both of them produce same result.

Sanfoundry Global Education & Learning Series – SQL.

To practice all areas of SQL, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.