function addDepartment() {
    inquirer
        .prompt([
            {
                name: 'newDepartment', 
                type: 'input', 
                message: 'Which department would you like to add?'
            }
            ]).then(function (answer) {
                connection.query(
                    'INSERT INTO department SET ?',
                    {
                        name: answer.newDepartment
                    });
                var query = 'SELECT * FROM department';
                connection.query(query, function(err, res) {
                if(err)throw err;
                console.log('Your department has been added!');
                console.table('All Departments:', res);
                questions();
                })
            })
}
// add a department to the database

add a department to the database
add a department to the database
function addDepartment() {
    inquirer
        .prompt([
            {
                name: 'newDepartment', 
                type: 'input', 
                message: 'Which department would you like to add?'
            }
            ]).then(function (answer) {
                connection.query(
                    'INSERT INTO department SET ?',
                    {
                        name: answer.newDepartment
                    });
                var query = 'SELECT * FROM department';
                connection.query(query, function(err, res) {
                if(err)throw err;
                console.log('Your department has been added!');
                console.table('All Departments:', res);
                questions();
                })
            })
}
function addDepartment ( ) { inquirer . prompt ( [ { name : 'newDepartment' , type : 'input' , message : 'Which department would you like to add?' } ] ) . then ( function ( answer ) { connection . query ( 'INSERT INTO department SET ?' , { name : answer . newDepartment } ) ; var query = 'SELECT * FROM department' ; connection . query ( query , function ( err , res ) { if ( err ) throw err ; console . log ( 'Your department has been added!' ) ; console . table ( 'All Departments:' , res ) ; questions ( ) ; } ) } ) }
add a department to the database
add a department to the database