CREATE DATABASE IF NOT EXISTS `livewire_crud`
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci;

USE `livewire_crud`;

CREATE TABLE IF NOT EXISTS `employees` (
    `id` bigint unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(100) NOT NULL,
    `email` varchar(150) NOT NULL,
    `phone` varchar(20) DEFAULT NULL,
    `department` varchar(100) NOT NULL,
    `salary` decimal(10,2) NOT NULL DEFAULT 0.00,
    `status` tinyint(1) NOT NULL DEFAULT 1,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `employees_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `employees` (`name`, `email`, `phone`, `department`, `salary`, `status`, `created_at`, `updated_at`) VALUES
('Anil Kumar Patel', 'anil@example.com', '9876543210', 'Development', 55000.00, 1, NOW(), NOW()),
('Priya Sharma', 'priya@example.com', '9876501234', 'Marketing', 48000.00, 1, NOW(), NOW()),
('Rahul Verma', 'rahul@example.com', '9812345678', 'Sales', 45000.00, 0, NOW(), NOW())
ON DUPLICATE KEY UPDATE `updated_at` = NOW();
