SQL MCQs - Joins
11. A_____ is a query that retrieves rows from more than one table or view
A. Start
B. End
C. Join
D. All of the above
View Answer
Ans : C
Explanation: A Join is a query that retrieves rows from more than one table or view.
12. Which view that contains more than one table in the top-level FROM clause of the SELECT statement:
A. Join view
B. Datable join view
C. Updatable join view
D. All of the mentioned
View Answer
Ans : C
Explanation: Updatable join view that contains more than one table in the top-level FROM clause of the SELECT statement.
13. Which of the following statement is TRUE about FULL OUTER JOIN created on two tables Table1 and Table2?
A. Retrieves all the unmatched rows of Table1
B. Retrieves all the unmatched rows of Table2
C. Retrieves both matched and unmatched rows of Table1 and Table2
D. Retrieves only matched rows of table1 and Table2
View Answer
Ans : C
Explanation: The statement is TRUE about FULL OUTER JOIN created on two tables Table1 and Table2 is Retrieves both matched and unmatched rows of Table1 and Table2.
14. Which of the following statements are true?
A. INNER JOIN only retrieves those rows from Cartesian Product that satisfy the JOIN condition
B. FULL OUTER JOIN is same as CROSS JOIN
C. SELF JOIN is a special type of OUTER JOIN
D. Both A and C
View Answer
Ans : A
Explanation: INNER JOIN only retrieves those rows from Cartesian Product that satisfy the JOIN condition is true.
15. The following SQL is which type of join?
SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T WHERE CUSTOMER_T. CUSTOMER_ID = ORDER_T. CUSTOMER_ID
A. Equi-join
B. Natural join
C. Outer join
D. Cartesian join
View Answer
Ans : A
Explanation: Equi-join joins only same data entry field. For example, one table contains department id and another table should contain department id.
16. The following SQL is which type of join?
SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T
A. Equi-join
B. Natural join
C. Outer join
D. Cartesian join
View Answer
Ans : D
Explanation: Cartesian Join is simply the joining of one or more table which returns the product of all the rows in these tables.
17. Evaluate this SQL statement: In the statement, which capabilities of a SELECT statement are performed?
SELECT e.EMPLOYEE_ID,e.LAST_NAME,e.DEPARTMENT_ID, d.DEPARTMENT_NAME
FROM EMP e, DEPARTMENT d WHERE e.DEPARTMENT_ID = d.DEPARTMENT_ID;
A. Selection, projection, join
B. Difference, projection, join
C. Selection, intersection, join
D. Intersection, projection, join
View Answer
Ans : A
Explanation: In the statement, Selection, projection, join capabilities of a SELECT statement are performed
18. A SELECT statement can be used to perform these three functions:
- Choose rows from a table.
- Choose columns from a table.
- Bring together data that is stored in different tables by creating a link between them.
Which set of keywords describes these capabilities?
A. difference, projection, join
B. selection, projection, join
C. Selection, intersection, join
D. Intersection, projection, join
View Answer
Ans : B
Explanation: selection, projection, join is the answer.
Also check :
Discussion