function updateEmployee(item,role) {

    inquirer
     .prompt([
         {
             type: 'list',
             name: 'choice',
             message: "Choose an employee to update",
             choices: item
         },
         {
            type: 'list',
            name: 'role',
            message: "Choose a new role",
            choices: role
        }
     
       
    ])
        .then (answer => {
            
            // variables to select the first word in a string
            let sr = answer.role.split(" ")
            let ar = sr[0]

            let sc = answer.choice.split(" ")
            let ac = sc[0]


            db.query(`UPDATE employees set role_id = ${ar} where id =${ac}`, function (err, results) {

            start();
             
            })

        })
      
        .catch(err => { console.log(err)});

}
// function to update the users selection
function to update the users selection
function to update the users selection
function updateEmployee(item,role) {
    inquirer
     .prompt([
         {
             type: 'list',
             name: 'choice',
             message: "Choose an employee to update",
             choices: item
         },
         {
            type: 'list',
            name: 'role',
            message: "Choose a new role",
            choices: role
        }
    ])
        .then (answer => {
            let sr = answer.role.split(" ")
            let ar = sr[0]
            let sc = answer.choice.split(" ")
            let ac = sc[0]
            db.query(`UPDATE employees set role_id = ${ar} where id =${ac}`, function (err, results) {
            start();
            })
        })
        .catch(err => { console.log(err)});
}
function updateEmployee ( item , role ) { inquirer . prompt ( [ { type : 'list' , name : 'choice' , message : "Choose an employee to update" , choices : item } , { type : 'list' , name : 'role' , message : "Choose a new role" , choices : role } ] ) . then ( answer => { let sr = answer . role . split ( " " ) let ar = sr [ 0 ] let sc = answer . choice . split ( " " ) let ac = sc [ 0 ] db . query ( ` ${ ar } ${ ac } ` , function ( err , results ) { start ( ) ; } ) } ) . catch ( err => { console . log ( err ) } ) ; }
function to update the users selection
function to update the users selection
// variables to select the first word in a string