Horizontal vs Vertical Database Partitioning Quiz Quiz

Deepen your understanding of database partitioning techniques with this quiz focused on horizontal and vertical partitioning. Explore differences, scenarios, and benefits associated with each approach to optimize data structure and performance.

  1. Identifying Horizontal Partitioning

    Which form of database partitioning divides a table into subsets of rows, often based on a key like customer ID or region?

    1. Incremental partitioning
    2. Horizontal partitioning
    3. Vertical partitioning
    4. Diagonal partitioning

    Explanation: Horizontal partitioning splits a table by rows, grouping similar records together based on a chosen attribute like region. Vertical partitioning divides by columns, not rows. Diagonal and incremental partitioning are not standard database partitioning methods and do not correctly describe dividing tables by rows. Therefore, only horizontal partitioning fits the scenario described.

  2. Identifying Vertical Partitioning

    If a database administrator separates a user table into one part containing user names and emails, and another with passwords and security settings, which type of partitioning is being used?

    1. Centralized partitioning
    2. Horizontal partitioning
    3. Rotational partitioning
    4. Vertical partitioning

    Explanation: Vertical partitioning involves splitting a table by columns so that each partition holds different attributes. In this example, columns are grouped into subsets. Horizontal partitioning would separate by rows instead. Centralized and rotational partitioning are not standard terms in this context and do not involve splitting by columns.

  3. Benefit of Horizontal Partitioning

    What is a primary advantage of horizontal partitioning in very large datasets, such as millions of sales transactions?

    1. Reduces number of attributes per row
    2. Allows simultaneous use of multiple primary keys
    3. Improved query speed for specific regions
    4. Easier addition of new columns

    Explanation: Horizontal partitioning allows queries to target only specific partitions—for example, sales transactions from a certain region—which speeds up data retrieval. Adding columns is a benefit of vertical partitioning, not horizontal. Reducing attributes per row is unrelated, and a table can only have one primary key regardless of partitioning method.

  4. Query Optimization with Vertical Partitioning

    Why might vertical partitioning be useful when some queries always access a subset of columns, such as addresses and contact details only?

    1. It makes all rows unique
    2. It stores rows in random order
    3. It enables queries to scan fewer columns, increasing speed
    4. It encrypts selected columns automatically

    Explanation: Vertical partitioning organizes frequently accessed columns together, so queries can read only those columns instead of the entire table, enhancing performance. Making rows unique is related to keys and normalization. Storing rows in random order or encryption are not direct benefits of vertical partitioning.

  5. Common Scenario for Horizontal Partitioning

    When a company distributes customer records so that accounts from Europe, Asia, and America are each stored in different table partitions, what technique is this?

    1. Horizontal partitioning
    2. Database sharding
    3. Vertical partitioning
    4. Data mirroring

    Explanation: Dividing data by customer region means partitioning by rows, a classic use case for horizontal partitioning. Vertical partitioning would divide columns, not accounts. Sharding is a broader scaling strategy but isn't specific to how rows are distributed within a table. Data mirroring refers to copying data, not partitioning.

  6. Distinct Feature of Vertical Partitioning

    Which unique characteristic defines vertical partitioning compared to horizontal partitioning?

    1. Uses different data types per partition
    2. Splits rows based on a numeric range
    3. Duplicates the data for backup
    4. Divides a table into sets of columns

    Explanation: Vertical partitioning separates a table by columns, grouping attributes together. Horizontal partitioning typically uses ranges or key values to split rows. Duplicating for backup is unrelated to partitioning, and partitions do not change data types; they organize structure.

  7. Selecting a Partitioning Strategy

    If most queries frequently require only basic product info (like name and price), which partitioning method can help reduce disk I/O during these queries?

    1. Randomized partitioning
    2. Horizontal partitioning
    3. Circular partitioning
    4. Vertical partitioning

    Explanation: Vertical partitioning allows storage of the most frequently accessed columns, like name and price, together for efficient queries, minimizing disk reads. Randomized and circular partitioning are not common strategies in standard database partitioning. Horizontal partitioning targets row distribution, not optimized column access.

  8. Impact on Indexing

    How does horizontal partitioning impact indexing in a large sales database?

    1. Indexing is incompatible with partitions
    2. It makes indexes obsolete
    3. Indexes only support one column per table
    4. Indexes can be created for each partition individually

    Explanation: Horizontal partitioning allows each partition to have tailored indexes, improving search performance within those partitions. Indexes are not limited to one column, nor do they become obsolete; rather, they are critical for performance. Indexing remains compatible with database partitions.

  9. Combining Partitioning Methods

    What is it called when a database uses both horizontal and vertical partitioning on a single table?

    1. Mutual partitioning
    2. Partial partitioning
    3. Hybrid partitioning
    4. Serial partitioning

    Explanation: Hybrid partitioning refers to the application of both horizontal and vertical methods to organize data more effectively. Serial, mutual, and partial partitioning are not established terms for combining both approaches. Only 'hybrid partitioning' accurately describes this scenario.

  10. Data Redundancy Considerations

    Which type of partitioning may increase redundancy if a primary key must remain in all partitions to maintain data integrity?

    1. Vertical partitioning
    2. Temporal partitioning
    3. Horizontal partitioning
    4. Functional partitioning

    Explanation: In vertical partitioning, maintaining data integrity often requires repeating the primary key in each partitioned table, leading to some redundancy. Horizontal partitioning does not need key duplication because each partition contains all columns for its rows. Temporal and functional partitioning are not directly relevant in this context.