Automatically generate pages from SQL

Use a shell script and WP-CLI in your SSH console.
Your shell script has to fetch each element of your table and launch the function of WP-CLI that creates a post in WordPress. You can even provide a sort of template in the call of the function. WP-CLI is a useful tool, but you can also do it your own way by using WordPress cli scripts (see documentation).