In terms of database design, what considerations should be taken into account when creating tables to store hierarchical data like categories and subcategories in PHP applications?

When designing tables to store hierarchical data like categories and subcategories in PHP applications, considerations should be taken to ensure efficient querying and data retrieval. One common approach is to use a nested set model, where each category is represented by a row in the table with additional columns to store the left and right boundaries of the category's subtree. This allows for easy retrieval of hierarchical data using SQL queries.

CREATE TABLE categories (
    id INT PRIMARY KEY,
    name VARCHAR(50),
    lft INT,
    rgt INT
);