https://www.nitendratech.com/database/sql-query-bash-script/
How to Run SQL Query Using Bash Script and Command-Line?