Why Promise is used in getAllPersons Function
SQL With Express
getAllPersons is database handling function, and it may take some time to get data from the database either you can wait for the results or perform some other tasks not dependent on the database results.
So we use promise for async programing in JS