What are the potential pitfalls of not normalizing database structures when storing data like football match results?

Not normalizing database structures when storing data like football match results can lead to redundant data, inconsistent data, and difficulties in updating or querying the database. To solve this issue, we should normalize the database by breaking down the data into separate tables and establishing relationships between them.

// Example of normalizing database structure for football match results

// Table structure for teams
CREATE TABLE teams (
    id INT PRIMARY KEY,
    name VARCHAR(50)
);

// Table structure for matches
CREATE TABLE matches (
    id INT PRIMARY KEY,
    home_team_id INT,
    away_team_id INT,
    home_team_score INT,
    away_team_score INT,
    match_date DATE,
    FOREIGN KEY (home_team_id) REFERENCES teams(id),
    FOREIGN KEY (away_team_id) REFERENCES teams(id)
);

// Inserting data into teams table
INSERT INTO teams (id, name) VALUES (1, 'Team A');
INSERT INTO teams (id, name) VALUES (2, 'Team B');

// Inserting data into matches table
INSERT INTO matches (id, home_team_id, away_team_id, home_team_score, away_team_score, match_date) 
VALUES (1, 1, 2, 2, 1, '2022-01-01');