Check out example codes for "how to get mysql db size". It will help you in understanding the concepts better.

Code Example 1

SELECT table_schema "DB Name",
        ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" 
FROM information_schema.tables 
GROUP BY table_schema;

Learn ReactJs, React Native from akashmittal.com