Because its asynchronous code. You need to put your code in the block of callback if you want waiting until finish
sql = "select * from muser" ;
db.executeSql(sql,{})
.then((data) => {
console.log("Got data from DB");
Http.post(url, data); // here send your data to your server.
})
.catch(e => console.log(e))