Check out example codes for "node js query mysql". It will help you in understanding the concepts better.

Code Example 1

con.connect(function(err) {
  if (err) throw err;
  console.log("Connected!");

   
  con.query(sql, function (err, result) {
    if (err) throw err;
    console.log("Result: 
  " + result);
  });
});

Learn ReactJs, React Native from akashmittal.com