What are the advantages and disadvantages of creating multiple columns for keywords versus using a separate table for keyword relationships?

When dealing with keyword relationships in a database, using multiple columns for keywords can make querying and filtering easier, but it can lead to redundant data and make it harder to add or remove keywords. On the other hand, using a separate table for keyword relationships allows for a more flexible and normalized database structure, but it may require more complex joins and queries to retrieve the data.

// Using a separate table for keyword relationships
CREATE TABLE articles (
    id INT PRIMARY KEY,
    title VARCHAR(100),
    content TEXT
);

CREATE TABLE keywords (
    id INT PRIMARY KEY,
    keyword VARCHAR(50)
);

CREATE TABLE article_keywords (
    article_id INT,
    keyword_id INT,
    PRIMARY KEY (article_id, keyword_id),
    FOREIGN KEY (article_id) REFERENCES articles(id),
    FOREIGN KEY (keyword_id) REFERENCES keywords(id)
);