'Get a list of tables and their fields from the database

I need to get a list of tables and their fields from a certain database.

As a result, I would like to obtain the following command:

show tables + show table stats



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source