CCDM practice question 22 of 25

A data manager takes the INTERSECTION data in two tables wanting only the 50 records common to both tables. What operation did the data manager perform?

Full set: 150 questions
Answer options
A: Left outer join
B: Right outer join
C: Inner join Correct answer
D: Full outer join
Correct Answer:
C. Inner join
Explanation

An INNER JOIN is a relational database operation that selects records that have matching values in both tables. The result is a new table containing only the rows where the join condition is met. This operation is functionally equivalent to finding the intersection of two sets, which aligns with the data manager's goal of isolating the 50 records common to both tables.

Why Incorrect

A. Left outer join: This is incorrect because it returns all records from the left table and only the matched records from the right table, not just the common records.
B. Right outer join: This is incorrect because it returns all records from the right table and only the matched records from the left table.
D. Full outer join: This is incorrect as it returns all records from both tables, combining matched and unmatched rows, which represents a union, not an intersection.

References

1. Silberschatz, A., Korth, H. F., & Sudarshan, S. (2019). Database System Concepts (7th ed.). McGraw-Hill. In Chapter 3, "Introduction to SQL," Section 3.4, "Join Expressions," the text defines an inner join as returning only those tuples from the Cartesian product of the two relations that satisfy the join condition.

2. Ullman, J. D., & Widom, J. (2008). A First Course in Database Systems (3rd ed.). Pearson/Prentice Hall. Chapter 6, "Queries in SQL," Section 6.3.1, "Joins," explains that the basic join (an inner join) combines tuples from two relations where specified attributes are equal, effectively filtering for matching records only.

3. Stanford University. (n.d.). CS145 Introduction to Databases, Lecture 2: SQL. Retrieved from https://web.stanford.edu/class/cs145/notes/02-sql.pdf. On slide 28, the notes specify that an INNER JOIN will "Only include rows from both tables that match the ON condition," which corresponds to an intersection.

Scroll to Top