text: DROP DATABASE IF EXISTS employee_db;
  
  CREATE DATABASE employee_db;
  
  USE employee_db;
  
  CREATE TABLE departments (
    id INT NOT NULL AUTO_INCREMENT,
    name varchar(100) NOT NULL,
    PRIMARY KEY (id)
  );
  
  CREATE TABLE roles (
    id INT NOT NULL AUTO_INCREMENT,
    title varchar(100) NOT NULL,
    salary decimal NOT NULL,
    department_id INT NOT NULL,
    PRIMARY KEY (id),
    FOREIGN KEY (department_id) REFERENCES departments(id)
  );
  
  CREATE TABLE employees (
    id INT NOT NULL AUTO_INCREMENT,
    first_name varchar(100) NOT NULL,
    last_name varchar(100) NOT NULL,
    role_id INT NOT NULL,
    manager_id INT,
    PRIMARY KEY (id),
    FOREIGN KEY (role_id) REFERENCES roles(id),
    FOREIGN KEY (manager_id) REFERENCES employees(id)
  );
  
  
  
  