Get the MySQL database schema using SQL
A complete database schema can be retrieved using the following MySQL statement from the information_schema database:
SELECT * FROM SCHEMATA LEFT JOIN tables ON table_schema = schema_name LEFT JOIN columns ON tables.table_name = columns.table_name WHERE schema_name = '<DATABASE_NAME>';