SQL Questions and Answers – SQL Inner Join

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

1. When there are no matching values between two tables of a database, which of the following join returns zero records?
a) Self join
b) Full join
c) Inner join
d) Right join
View Answer

Answer: c
Explanation: The INNER JOIN keyword selects all rows from both the tables as long as the condition satisfies. If no matching values exist between them, they cannot be combined and hence results in zero records.

2. Which of the following keyword can be used along with INNER JOIN in SQL?
a) Of
b) On
c) By
d) Combine
View Answer

Answer: b
Explanation: ON keyword can be used along with INNER JOIN, whenever the join condition is not specified in where clause. If the join condition is specified in WHERE clause, then there is no need of ON.

3. Where the join condition should be mentioned, if ON keyword is not used in a query?
a) From
b) Select
c) Where
d) Join
View Answer

Answer: c
Explanation: If on keyword is not used in a query, then the join condition must be specified in the where clause.
advertisement

4. What is the basic syntax for using INNER JOIN?
a)

SELECT column_list
FROM table1
INNER JOIN table2 ON table1.column = table2.column;

b)

Free 30-Day Java Certification Bootcamp is Live. Join Now!
SELECT column_list
FROM table1
INNER JOIN table2;

c)

SELECT column_list
FROM table1 ON table1.column = table2.column
INNER JOIN table2;

d)

advertisement
SELECT column_list
FROM table1
INNER JOIN table2 table1.column = table2.column;
View Answer
Answer: a
Explanation: Inner join is used to combine two or more tables based on a given condition. So, condition is necessary for INNER JOIN. Either ON or WHERE clause should be used to mention the condition(s).

5. Which of the following sets is similar to table1 INNER JOIN table2?
a) Table1 U Table2
b) Table1 – Table2
c) Table1 ∩ Table2
d) Table1 – Table2
View Answer

Answer: c
Explanation: Table1 ∩ Table2 results the matching columns between those tables. SQL INNER JOIN returns all rows from multiple tables where the join condition is met. So Table1 INNER JOIN Table2 is similar to Table1 ∩ Table2.

Sanfoundry Global Education & Learning Series – SQL.

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

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
I’m Manish - Founder and CTO at Sanfoundry. I’ve been working in tech for over 25 years, with deep focus on Linux kernel, SAN technologies, Advanced C, Full Stack and Scalable website designs.

You can connect with me on LinkedIn, watch my Youtube Masterclasses, or join my Telegram tech discussions.

If you’re in your 40s–60s and exploring new directions in your career, I also offer mentoring. Learn more here.