text: -- DROP TABLES IF EXIST
  
  DROP TABLE IF EXISTS dept_emp;
  DROP TABLE IF EXISTS dept_manager;
  DROP TABLE IF EXISTS departments;
  DROP TABLE IF EXISTS salaries;
  DROP TABLE IF EXISTS employees;
  DROP TABLE IF EXISTS titles;
  --
  
  CREATE TABLE Departments (
      dept_no VARCHAR  NOT NULL ,
      dept_name VARCHAR  NOT NULL ,
      CONSTRAINT pk_Departments PRIMARY KEY (
          dept_no
      )
  );
  
  
  
  CREATE TABLE Dept_emp (
      emp_no INTEGER  NOT NULL ,
      dept_no VARCHAR  NOT NULL 
  );
  
  
  
  CREATE TABLE Dept_manager (
      dept_no VARCHAR  NOT NULL ,
      emp_no INTEGER  NOT NULL 
  );
  
  
  
  CREATE TABLE Employees (
      emp_no INTEGER  NOT NULL ,
      emp_title_id VARCHAR  NOT NULL ,
      birth_date VARCHAR  NOT NULL ,
      first_name VARCHAR  NOT NULL ,
      last_name VARCHAR  NOT NULL ,
      sex VARCHAR  NOT NULL ,
      hire_date VARCHAR  NOT NULL ,
      CONSTRAINT pk_Employees PRIMARY KEY (
          emp_no
      )
  );
  
  
  
  CREATE TABLE Salaries (
      emp_no INTEGER  NOT NULL ,
      salary INTEGER  NOT NULL 
  );
  
  
  
  CREATE TABLE Titles (
      title_id VARCHAR  NOT NULL ,
      title VARCHAR  NOT NULL ,
      CONSTRAINT pk_Titles PRIMARY KEY (
          title_id
      )
  );
  
  
  
  ALTER TABLE Dept_emp ADD CONSTRAINT fk_Dept_emp_emp_no FOREIGN KEY(emp_no)
  REFERENCES Employees (emp_no);
  
  
  ALTER TABLE Dept_emp ADD CONSTRAINT fk_Dept_emp_dept_no FOREIGN KEY(dept_no)
  REFERENCES Departments (dept_no);
  
  
  ALTER TABLE Dept_manager ADD CONSTRAINT fk_Dept_manager_dept_no FOREIGN KEY(dept_no)
  REFERENCES Departments (dept_no);
  
  
  ALTER TABLE Dept_manager ADD CONSTRAINT fk_Dept_manager_emp_no FOREIGN KEY(emp_no)
  REFERENCES Employees (emp_no);
  
  
  ALTER TABLE Employees ADD CONSTRAINT fk_Employees_emp_title_id FOREIGN KEY(emp_title_id)
  REFERENCES Titles (title_id);
  
  
  ALTER TABLE Salaries ADD CONSTRAINT fk_Salaries_emp_no FOREIGN KEY(emp_no)
  REFERENCES Employees (emp_no);
  
  SELECT * FROM departments;
  SELECT * FROM dept_emp;
  SELECT * FROM dept_manager;
  SELECT * FROM employees;
  SELECT * FROM salaries;
  SELECT * FROM titles;