Difficulty: Easy
Correct Answer: Both of the above are helpful
Explanation:
Introduction / Context:
Database redesign often begins with discovering how data is actually used, where integrity rules are enforced, and which rows have or lack related rows. SQL constructs like correlated subqueries and EXISTS/NOT EXISTS are invaluable for profiling relationships and finding anomalies.
Given Data / Assumptions:
Concept / Approach:
Correlated subqueries allow row-by-row checks against related tables. EXISTS/NOT EXISTS provide efficient presence/absence tests. Together, they expose referential patterns, cardinalities, and exceptions that shape the new design, indexes, and constraints.
Step-by-Step Solution:
Verification / Alternative check:
Explain plans typically show semi-joins or anti-joins for EXISTS/NOT EXISTS, which scale well with appropriate indexes and confirm their suitability for redesign analysis.
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
Both of the above are helpful
Discussion & Comments