QuizzesInheritance — Single Table Strategy — Concept Check
intermediate
hibernate

Inheritance — Single Table Strategy — Concept Check

Questions on Inheritance — Single Table Strategy. All subclass data is stored in one table with a DTYPE discriminator column; best performance (no joins) but wastes space with many nullable columns for sparse hierarchies.

7 minutes 7 questions Pass at 70%
Time Limit
7 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

7 questions on Inheritance — Single Table Strategy — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.A database table for a payment system uses SINGLE_TABLE strategy. What might be a consequence if many subclasses are added with unique fields?

    • AThe table will automatically split into multiple tables for efficiency.
    • BThe table will require frequent joins, slowing down queries.
    • CThe table will become wide and sparse, leading to wasted space.
    • DAll subclass fields will be NOT NULL, ensuring data integrity.
  2. 2.In a Hibernate application, you notice that querying the Payment class returns all types of payments without additional joins. What inheritance strategy is likely used?

    • AMULTI_TABLE
    • BTABLE_PER_CLASS
    • CSINGLE_TABLE
    • DJOINED
  3. 3.A developer wants to ensure subclass-specific fields are NOT NULL in the database. Which inheritance strategy should they avoid?

    • ATABLE_PER_CLASS
    • BJOINED
    • CMULTI_TABLE
    • DSINGLE_TABLE
  4. 4.A Hibernate query on the Payment class is slow due to multiple joins. Which inheritance strategy might be responsible?

    • AJOINED
    • BTABLE_PER_CLASS
    • CSINGLE_TABLE
    • DMULTI_TABLE
  5. 5.A developer uses SINGLE_TABLE strategy but notices many nullable columns in the database. What is a likely reason for this?

    • AThe discriminator column is missing.
    • BThe hierarchy has many subclasses with unique fields.
    • CThe database is incorrectly configured.
    • DThe strategy is incorrectly set to TABLE_PER_CLASS.
  6. 6.Which strategy should be chosen for a shallow hierarchy with few subclass-specific fields to optimize query performance?

    • AJOINED
    • BMULTI_TABLE
    • CTABLE_PER_CLASS
    • DSINGLE_TABLE
  7. 7.In a SINGLE_TABLE strategy, what identifies which subclass a row represents?

    • AA discriminator column
    • BA unique index
    • CA foreign key constraint
    • DA join table