The document contains questions and answers about SQL joins and set operators. Joins combine rows from two or more tables based on a related column between them. The main types are inner, outer, cross and self joins. Set operators combine result sets from multiple queries, including union, intersect and except.
The document contains questions and answers about SQL joins and set operators. Joins combine rows from two or more tables based on a related column between them. The main types are inner, outer, cross and self joins. Set operators combine result sets from multiple queries, including union, intersect and except.
B. It merges two tables into one C. It combines columns from two or more tables into a single result set D. It combines result sets of two different queries into a single result set Answer: C [Ref. Page: 126] Q2. _____________ JOIN returns only those rows that satisfy the join condition. Pick the correct one for the blank space? A. An INNER JOIN B. An OUTER JOIN C. A CROSS JOIN D. A FULL OUTER JOIN Answer: A [Ref. Page: 127] Q3. In which case you must use the qualified name for a column in join query? A. For all columns B. For the column names that appear in two tables C. For the columns that participate in join condition D. All of the above Answer: B Q4. You the following Query SELECT Products.*, SupplierID FROM Products INNER JOIN Suppliers ON Products.SupplierID = Suppliers.SupplierID Should the Query Work? A. Yes B. No Answer: B [SupplerID is present in both Products and Suppliers table. You should use Products.SupplierID or Suppliers.SupplierID in column list] Q5. _____________are temporary table names assigned in the FROM clause in a SELECT statement. A. Virtual names B. Correlation names C. Dummy names D. Short names Answer: B [Also called table alias, Ref. Page: 129] Q6. When you must use fully qualified names for database objects? A. If you want to access to objects reside in different schema B. If you have limited rights on objects C. If objects reside in different database D. All of the above Answer: C [Ref. Page: 130] Q7. Which one is the correct form of fully-qualified name of database objects? A. database.object B. schema.object C. database.schema.object D. server.database.schema.object Answer: D [Ref. Page: 131] Q8. _______________is a virtual instance of remote server linked to the current existing server. A. A linked server B. A server instance C. A virtual server D. A paired server Answer: A Q9. SQL Server lets you join data from up ______tables. A. 32 B. 64 C. 128 D. 256 Answer: D [Ref. Page: 153] Q10. _________ allow all rows from one or more tables to be included in the result set. Select the correct one for the blank. A. Inner joins B. Outer joins C. Cross joins D. Distributed queries Answer: B Q11. _____________retrieves all rows that satisfies the join condition, plus unmatched rows from one or both tables. A. An inner join B. An outer join C. A cross join D. A self-join Answer: B Q12. A CROSS JOIN does not require an ON operator? Is it true? A. Yes B. No Answer: A Q13. Which type of JOIN returns a Cartesian product of all the records on both sides of the JOIN? A. INNER JOIN B. OUTER JOIN C. CROSS JOIN D. SELF JOIN Answer: C
Q14. Which one is an alternative of LEFT JOIN?
A. *= B. =* C. *=* D. == Answer: A Q15. Which one is an alternative of RIGHT OUTER JOIN? A. *= B. =* C. *=* D. == Answer: B Q6. Which one is the old left outer join operators? A. *= B. =* C. ! = D. #= Answer: A Q17. You have the following query SELECT v.VendorName, a.Address FROM Vendors v CROSS JOIN Address a Which one will return the same result set as the above? A. SELECT v.VendorName, a.Address FROM Vendors v, Address a B. SELECT v.VendorName, a.Address FROM Vendors v SELF JOIN Address a hi C. SELECT v.VendorName, a.Address FROM Vendors v JOIN Address a D. SELECT v.VendorName, a.Address FROM Vendors v FULL OUTER JOIN Address a Answer: A Q18. You want to combine the rows from result sets of two select statements into one result. What would you use? A. Inner Join B. Outer Join C. Cross Join D. Union Answer: D Q19. By default, a union does not remove duplicates. A. True B. False Answer: B Q20. If you want to include duplicates in a union, what should you do? A. Add ALL keyword after UNION B. Add ANY keyword after UNION C. Add * symbol after UNION D. You need not do anything, unions include duplicates by default Answer: A Q21. Which of the following is or are set operators? A. EXCEPT, INTERSECT B. FETCH, NEXT C. GROUP BY, HAVING D. =*, *= Answer: A [Ref. Page: 171] Q22. _________operator excludes rows from first query those occur in the second query. A. EXCEPT B. INTERSECT C. UNION D. IN Answer: A Q23. _________ returns distinct rows that are output by both the left and right input queries operator. A. EXCEPT B. INTERSECT C. UNION D. IN Answer: B