Database Questions and Answers – Join Expressions

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

1. The____condition allows a general predicate over the relations being joined.
a) On
b) Using
c) Set
d) Where
View Answer

Answer: a
Explanation: On gives the condition for the join expression.

2. Which of the join operations do not preserve non matched tuples?
a) Left outer join
b) Right outer join
c) Inner join
d) Natural join
View Answer

Answer: c
Explanation: INNER JOIN: Returns all rows when there is at least one match in BOTH tables.

3.

advertisement
advertisement
SELECT *
  FROM student JOIN takes USING (ID);

The above query is equivalent to
a)

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!
   SELECT *
   FROM student INNER JOIN takes USING (ID);

b)

advertisement
   SELECT *
   FROM student OUTER JOIN takes USING (ID);

c)

advertisement
   SELECT *
   FROM student LEFT OUTER JOIN takes USING (ID);

d) None of the mentioned
View Answer

Answer: a
Explanation: Join can be replaced by inner join.

4. What type of join is needed when you wish to include rows that do not have matching values?
a) Equi-join
b) Natural join
c) Outer join
d) All of the mentioned
View Answer

Answer: c
Explanation: An outer join does not require each record in the two joined tables to have a matching record..

5. How many tables may be included with a join?
a) One
b) Two
c) Three
d) All of the mentioned
View Answer

Answer: d
Explanation: Join can combine multiple tables.

6. Which are the join types in join condition:
a) Cross join
b) Natural join
c) Join with USING clause
d) All of the mentioned
View Answer

Answer: d
Explanation: There are totally four join types in SQL.

7. How many join types in join condition:
a) 2
b) 3
c) 4
d) 5
View Answer

Answer: d
Explanation: Types are inner join, left outer join, right outer join, full join, cross join.

8. Which join refers to join records from the right table that have no matching key in the left table are include in the result set:
a) Left outer join
b) Right outer join
c) Full outer join
d) Half outer join
View Answer

Answer: b
Explanation: RIGHT OUTER JOIN: Return all rows from the right table and the matched rows from the left table.

9. The operation which is not considered a basic operation of relational algebra is
a) Join
b) Selection
c) Union
d) Cross product
View Answer

Answer: a
Explanation: None.

10. In SQL the statement select * from R, S is equivalent to
a) Select * from R natural join S
b) Select * from R cross join S
c) Select * from R union join S
d) Select * from R inner join S
View Answer

Answer: b
Explanation: None.

Sanfoundry Global Education & Learning Series – Database Management System.

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.