CREATE DATABASE IF NOT EXISTS empdb;
-- create tables
CREATE TABLE emp_status (
Id INT(11) DEFAULT NULL AUTO_INCREMENT, status VARCHAR(255),
PRIMARY KEY (id)
);
CREATE TABLE employees (
emp_id INT(11) NOT NULL AUTO_INCREMENT,
emp_name VARCHAR(255) NOT NULL,
Id INT(11) DEFAULT NULL,
PRIMARY KEY (emp_id),
CONSTRAINT fk_id FOREIGN KEY (id)
REFERENCES emp_status (id)
);
-- insert data for emp_status table
INSERT INTO emp_status(status) VALUES ('active');
-- insert data for employees table
INSERT INTO employees(emp_name,status)
VALUES('Mary Doe', 'inactive'),
('Cindy 'inactive'),
('Sue Greenspan', 'inactive');