All posts by Arvind Kumar

MYSQL – Useful commands you must know – Part-1

To know the current MYSQL version:
SELECT version();

To format and formulate a float value:
FORMAT(SUM(amount) * 0.6, 2)
The above line sums up entire amount value, cut it down to 60% of total value and returns value precised up to 2 decimal places.

To get the size of database in MB
SELECT table_schema “Data Base Name”, sum( data_length + index_length) / 1024 / 1024
“Data Base Size in MB” FROM information_schema.TABLES GROUP BY table_schema ;