What are the best practices for designing database tables in PHP applications with multiple teams or categories?

When designing database tables in PHP applications with multiple teams or categories, it is important to use a normalized database structure to avoid redundancy and ensure data integrity. One common practice is to create separate tables for teams and categories, and then establish relationships between them using foreign keys. This allows for more efficient querying and easier maintenance of the database.

CREATE TABLE teams (
    id INT PRIMARY KEY,
    name VARCHAR(50) NOT NULL
);

CREATE TABLE categories (
    id INT PRIMARY KEY,
    name VARCHAR(50) NOT NULL
);

CREATE TABLE team_categories (
    team_id INT,
    category_id INT,
    PRIMARY KEY (team_id, category_id),
    FOREIGN KEY (team_id) REFERENCES teams(id),
    FOREIGN KEY (category_id) REFERENCES categories(id)
);