How can redundancy in customer data be avoided when designing a database structure for survey data in PHP?

To avoid redundancy in customer data when designing a database structure for survey data in PHP, you can create separate tables for customers and survey responses, linking them through a unique identifier like customer ID. This way, customer information is stored only once and can be referenced in the survey responses table. This approach helps maintain data integrity and reduces redundancy.

CREATE TABLE customers (
    customer_id INT PRIMARY KEY,
    name VARCHAR(50),
    email VARCHAR(50),
    phone VARCHAR(20)
);

CREATE TABLE survey_responses (
    response_id INT PRIMARY KEY,
    customer_id INT,
    survey_date DATE,
    response TEXT,
    FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
);