Bird
0
0

Why is a self join necessary to query hierarchical data stored in a single table instead of using multiple tables?

easy📝 Conceptual Q10 of 15
SQL - Advanced Joins
Why is a self join necessary to query hierarchical data stored in a single table instead of using multiple tables?
ABecause SQL does not support joins between different tables
BBecause self joins improve query speed over normal joins
CBecause multiple tables cause data duplication
DBecause hierarchical relationships are stored as references within the same table rows
Step-by-Step Solution
Solution:
  1. Step 1: Understand hierarchical data storage

    Hierarchies in one table use columns referencing other rows in the same table.
  2. Step 2: Role of self join

    Self join allows linking these rows to show parent-child or manager-subordinate relationships.
  3. Final Answer:

    Because hierarchical relationships are stored as references within the same table rows -> Option D
  4. Quick Check:

    Self join needed for intra-table references [OK]
Quick Trick: Self join links rows referencing each other in same table [OK]
Common Mistakes:
MISTAKES
  • Thinking SQL can't join different tables
  • Assuming multiple tables always better
  • Confusing self join with performance optimization

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes