CREATE TABLE IF NOT EXISTS contacts (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    email VARCHAR(255) UNIQUE,
    phone VARCHAR(50),
    company VARCHAR(255),
    status VARCHAR(50) DEFAULT 'Lead',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Insert some dummy data for initial view
INSERT INTO contacts (name, email, phone, company, status) VALUES
('Alice Johnson', 'alice.j@example.com', '123-456-7890', 'Innovate Inc.', 'Lead'),
('Bob Williams', 'bob.w@example.com', '234-567-8901', 'Solutions Corp.', 'Contacted'),
('Charlie Brown', 'charlie.b@example.com', '345-678-9012', 'Data Systems', 'Qualified'),
('Diana Prince', 'diana.p@example.com', '456-789-0123', 'Global Tech', 'Lead')
ON DUPLICATE KEY UPDATE name=name; -- Do nothing if email exists