To create and manage MySQL databases only over the command line can be quite challenging. You may know to the browser-based tool “phpMyAdmin”, but this tool has some limitations (e.g. no visual data base design)
To overcome this problem, you can download the MySQL Workbench from https://www.mysql.com/de/products/workbench
Install the program, start it and add your database credentials using the plus right to “MySQL Connections”. Caution, maybe not every database can be accessed directly throw the internet, many databases listen only to localhost for security reasons. If this is the case, use Standard TCP/IP over SSH to let MySQL Workbench to create an SSH tunnel for you.
Now you can use the MySQL Workbench to create and manage your databases.
Joins are more expensive than a pure concatenation. In your case maybe UNION or UNION ALL might be a good solution because it parses the first SELECT statement and moves on to the next SELECT statement and adds the results to the end of an output table. The finding of the different connections of the joined tables is a huge cost factor.
First, the Site Address and the WordPress address need to be updated. Go to Settings->General in the WordPress administration area and change the value of these two settings to the new URL. New contents are now created with HTTPS.
Unfortunately, changing the site address does not update URLs in existing contents, so a SQL-Statement to replace the old URLs with new one is required (replace example.org with the URL of the site to move):
UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://www.example.org', 'https:// www.example.org)