database

a minute read
we can execute a query that will list all tables in a specific database along with the disk space (size) of each. We can list all the tables along with each table size (disk space) by using a query. SELECT table_name AS Table, ROUND(((data_length + index_length) / 1024 / 1024), 2) Size (MB) FROM information_schema.TABLES WHERE table_schema = “$Database_Name”; Query to get list the size of every table in every database, with of the order of size: SELECT table_schema as Da...
4 minutes read
How can I find non-ASCII characters in MySQL?   Query to find data as  “ASCII”, SELECT * FROM tableName WHERE NOT columnToCheck REGEXP '[A-Za-z0-9]'; 1 SELECT * FROM tableName WHERE NOT columnToCheck REGEXP '[A-Za-z0-9]'; Query to find the “Non ASCII ” SELECT * FROM my_table WHERE NOT HEX(my_column) REGEXP '^([0-7][0-9A-F])*$' 1 ...
5 minutes read
Below Mysql query is very useful to Get list of column name from table with its datatype. You can get list of all the tables name and all the fields count with help of this query. PHP Mysql Query In below query just change <–YoursDatabaseName–> to your database and <–YoursTableName–> to your table name where you just want Field values of DESCRIBE statement //Get total number of TABLES IN a DATABASE SELECT COUNT(*) AS totalTables FROM information_schem...