RSS Feed

Multiple Choice Questions - SQL Joins - Set 3

Multiple Choice Questions - SQL Joins - Set 3

1.
To avoid a Cartesian product, always include a valid join condition in a WHERE clause.

A) True
B) False

2.


Above image depicts:

A) Outer Join
B) Inner Join
C) Self Join
D) Right Outer Join

3.
Select the correct query/queries for cross join:

A)
Select * FROM Table1 T1 CROSS JOIN Table1 T2;
B)
Select * FROM Table1 T1 ALL CROSS JOIN Table1 T2;
C)
Select * FROM Table1 T1,Table1 T2;
D)
Select * FROM Table1 T1 CROSS Table1 T2;

4.
Self-JOIN can be attained by ........ based on requirement but table must join with itself.

A) INNER-JOIN
B) OUTER-JOIN
C) CROSS-JOIN
D) All of above
E) Both A & B

5.
LEFT JOIN and LEFT OUTER JOIN are equivalent.

A) True
B) False

6.

Choose th equery that matches the above image.

A.
Select [List] 
from [Table A] A
inner join
 [Table B] B
on A.value=B.value
B.
Select [List] 
from [Table A] A
full outer join
 [Table B] B
on A.value=B.value
where A.value is null
or B.value is null
C.
Select [List] 
from [Table A] A
right join
 [Table B] B
on A.value=B.value
where A.value is null
D.
Select [List] 
from [Table A] A
full outer join
 [Table B] B
on A.value=B.value
7.
Below two tables (A & B) are given.

A
1
2
3
4

B
3
4
5
6


What will be the result of inner join between these tables?
A)
A B
1 3
4 4

B)
A B
3 1
4 4

C)
A B
2 3
2 4

D)
A B
3 3
4 4

8.
Understanding the primary and foreign key relationship is not important to join on the correct columns.

A) True
B) False

9.
Use left or right outer join with ...... when you are looking for something in one table that doesn’t exist in another table.

A) null condition
B) inclusions
C) exclusions
D) none of above

10.
You can drop OUTER keyword and just say LEFT JOIN or RIGHT JOIN or FULL JOIN.

A) True
B) False

Answers