Database Management MySQL Subjective
Oct 01, 2025

Explain MySQL partitioning and its benefits.

Detailed Explanation

Partitioning divides large tables into smaller, manageable pieces.

Types:
• RANGE: Based on value ranges
• LIST: Based on specific values
• HASH: Based on hash function
• KEY: Similar to HASH but uses MySQL function

Example:
CREATE TABLE sales (
  id INT,
  sale_date DATE
) PARTITION BY RANGE (YEAR(sale_date)) (
  PARTITION p2023 VALUES LESS THAN (2024),
  PARTITION p2024 VALUES LESS THAN (2025)
);

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback