Answers for "table size database size in mb"

SQL
0

table size database size in mb

##############################################################
#Database size in MB


SELECT table_schema AS "Database", 
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" 
FROM information_schema.TABLES 
GROUP BY table_schema;

##############################################################
#Table Size in MB per database

SELECT table_name AS "Table",
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)"
FROM information_schema.TABLES
WHERE table_schema = "database_name"
ORDER BY (data_length + index_length) DESC;
Posted by: Guest on July-07-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language