JOINS AND SUBQUERY
MULTIPLE CHOICE WITH ANSWER
Answer:
1)
When you join a table without any condition it will lead to cartesian product
True
False
​
2)
_____________column specifies which columns to test for equality when two tables are joined
a.Having
b.Like
c.using
d.Where
​
3)
<ANY> means___________
a.No equal to in
b.Equivalent to In]
c.Less than the minimum
d.less than the maximum
​
4)
Consider the following table:
Product Table
Column Name DataType Constraint
prod_name Varchar2(20)
prod_id Number(10) PK
Customer Table
Column Name DataType Constraint
cust_last_name Varchar2(20)
cust_id Number(10) PK
cust_city Varchar2(20)
Sales Table
Column Name DataType Constraint
prod_id Number(10) FK
cust_id Number(10) FK
quantity_sold Number(10,2)
Which SELECT statement displays all the employees who do not have any subordinates?
Select one:
a. SELECT e.ename
FROM emp e
WHERE e.empno IN (SELECT m.mgr
FROM emp m);
b. SELECT e.ename
FROM emp e
WHERE e.mgr IS NOT NULL;
c. SELECT e.ename
FROM emp e
WHERE e.empno NOT IN (SELECT m.mgr
FROM emp m
WHERE m.mgr IS NOT NULL);
d. SELECT e.ename
FROM emp e
WHERE e.empno NOT IN (SELECT m.mgr
FROM emp m);
​
​
5)
WHAT IS THE DEFAULT JOIN TYPE
a.Inner join
b.Outer join
c.Self join
d.Equi join