title: SQL Check if table exists then Create Table & Insert into same query
body: <p>Tried This Code But it gives "<strong>ER_PARSE_ERROR</strong>"</p>
  
  <p><strong>Err Description</strong>: "sqlMessage": "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Insert values ('Bitcoin')' at line 1"</p>
  
  <pre><code>var query = "CREATE TABLE IF NOT EXISTS projects (project_name VARCHAR(10)) Insert values ('" + projectName + "')";
  </code></pre>
  
  <p>I want to Insert a new Project in the Projects Table, create the table if it does not exists and insert the record, I can write multiple queries for this work and check response if success then proceed with the next query but I am looking for a query which does all the work concatenating multiple queries in itself.</p>
  
  <p>Note: I am using mysql module in Nodejs</p>
  
  <p>The process should work synchronously one after the other, when a user sends a post request to the route '/add_project' with data in body "project_name":"project1" then the server inserts the record in the mysql table projects but it generates err "No such Table " if that was the first record.
  I want it to work synchronously first by creating the table if not exists and then inserting the record.</p>
  
  <p>Edit: Added screenshot for @Nick suggestion
  <a href="https://i.stack.imgur.com/47dmZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/47dmZ.png" alt="Screenshot"></a></p>