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

Code Example 1

var mysql = require('mysql');

var con = mysql.createConnection({
  host: "localhost",
  user: "yourusername",
  password: "yourpassword",
  database: "mydb"
});

con.connect(function(err) {
  if (err) throw err;
  console.log("Connected!");
  
  con.query(`CREATE TABLE customers (
    name VARCHAR(255),
    address VARCHAR(255)
  )`, (err, result) => {
    if (err) throw err;
    
    console.log("Table created!");
  });
});

Learn ReactJs, React Native from akashmittal.com