server.js
// View employees function called in switch
View employees function called in switch
View employees function called in switch
function viewEmployees() {
  let query =
    "select employee.id, employee.first_name, employee.last_name, employee_role.title, department.name as 'Department', employee_role.salary, (select concat(employee.first_name, employee.last_name) from employee where employee.manager_id = employee.id ) as 'Manager' from employee join employee_role on employee.role_id = employee_role.id join department on department.id = employee_role.department_id;";
  connection.query(query, function (err, res) {
    if (err) throw err;
    for (i = 0; i < res.length; i++) {
      console.table(res[i]);
    }
    start();
  });
}
function viewEmployees ( ) { let query = "select employee.id, employee.first_name, employee.last_name, employee_role.title, department.name as 'Department', employee_role.salary, (select concat(employee.first_name, employee.last_name) from employee where employee.manager_id = employee.id ) as 'Manager' from employee join employee_role on employee.role_id = employee_role.id join department on department.id = employee_role.department_id;" ; connection . query ( query , function ( err , res ) { if ( err ) throw err ; for ( i = 0 ; i < res . length ; i ++ ) { console . table ( res [ i ] ) ; } start ( ) ; } ) ; }
View employees function called in switch
View employees function called in switch