Find the table sizes in MySQL database

Problem

You would like to have a list with all the tables in an MySQL database, sorted with their sizes (actual table and indices).

Solution

You could run the following query to give you a list of all the tables sorted by size:

SELECT
  table_schema AS database_name,
  table_name AS table_name,
  round(((data_length + index_length) / 1024 / 1024), 2) AS size_mb
FROM information_schema.TABLES
ORDER BY (data_length + index_length) DESC;

Take from the answer here

Exporting SQL structure commands from MySQL Workbench

Problem

You would like to export the structure of some specific MySQL tables using MySQL Workbench (ie to create same tables in another database).

Solution

Go to the table name, right click, select ‘Copy To Clipboard’, then ‘Create Statement’ and finally go to a new file or editor and paste the command from the clipboard.
Just have in mind that you may need to delete the AUTO_INCREMENT from the SQL.
Solution was described here