Can you explain the concept of a 1:1 relation in PHP database design and how it can be applied to user surveys?

A 1:1 relation in PHP database design refers to a situation where each record in one table corresponds to exactly one record in another table. This can be applied to user surveys by creating separate tables for users and their survey responses, where each user has a unique identifier linked to their responses.

// Creating tables for users and survey responses
CREATE TABLE users (
    id INT PRIMARY KEY,
    name VARCHAR(50)
);

CREATE TABLE survey_responses (
    id INT PRIMARY KEY,
    user_id INT,
    response TEXT,
    FOREIGN KEY (user_id) REFERENCES users(id)
);