filmov
tv
MySQL FAQ: How to Check the Size of Tables in MySQL?

Показать описание
In this short sql tutorial we'll show you how to check the size of a specific mysql table.
There are multiple queries you can employ to achieve your goal - the first one will return a result in kB, the second one - in MB, and the third one - in GB. Replace "wordpress" with your database name and "wp_users" with the name of the table you want to see the size of:
1) SELECT(data_length+index_length)/POWER(1024,1) AS Size_kB
WHERE table_schema='wordpress' and table_name='wp_users';
2) SELECT(data_length+index_length)/POWER(1024,2) AS Size_MB
WHERE table_schema='wordpress' and table_name='wp_users';
3) SELECT (data_length+index_length)/POWER(1024,3) AS Size_GB
WHERE table_schema='wordpress' and table_name='wp_users';
Enjoy and tell about this tutorial to your friends!
Below you can find a couple of sql interview questions and answers - make sure to glance through them before attending your next sql interview!
Q: How to protect against SQL injection?
A: Don't pass user input into a SQL query. You really don't need to pass a mysql advanced tutorial to know this - it's that simple!
Q: What is the file to adjust mysql server configuration?
Q: Is there a sql full course or any mysql tutorial that would cover mysql storage engines in more detail in all complex aspects?
A: Not that we know of, but if needed, we'll make a sql course talking about everything: sql basics, sql queries, sql vs nosql, sql for data analysis, etc.
Q: Is there a big data tutorial for those looking to work with big data on mysql server?
Q: I've heard that MyISAM performs row level locking?
A: No, that's a common misconception.
Q: MyISAM vs InnoDB performance - which one is better and why?
A: InnoDB - all of the features that were available in MyISAM are now available in InnoDB.
Q: What types of SQL indexes exist?
A: There are B-Tree indexes, R-Tree indexes, hash indexes, covering indexes, clustered indexes, multicolumn or composite SQL indexes, and prefix indexes.
Q: What is the most popular type of a mysql index?
A: A B-tree sql index is the most popular type of a mysql index.
Music:
Creative Commons — Attribution 3.0 Unported — CC BY 3.0
#shorts #reels #database #mysql
There are multiple queries you can employ to achieve your goal - the first one will return a result in kB, the second one - in MB, and the third one - in GB. Replace "wordpress" with your database name and "wp_users" with the name of the table you want to see the size of:
1) SELECT(data_length+index_length)/POWER(1024,1) AS Size_kB
WHERE table_schema='wordpress' and table_name='wp_users';
2) SELECT(data_length+index_length)/POWER(1024,2) AS Size_MB
WHERE table_schema='wordpress' and table_name='wp_users';
3) SELECT (data_length+index_length)/POWER(1024,3) AS Size_GB
WHERE table_schema='wordpress' and table_name='wp_users';
Enjoy and tell about this tutorial to your friends!
Below you can find a couple of sql interview questions and answers - make sure to glance through them before attending your next sql interview!
Q: How to protect against SQL injection?
A: Don't pass user input into a SQL query. You really don't need to pass a mysql advanced tutorial to know this - it's that simple!
Q: What is the file to adjust mysql server configuration?
Q: Is there a sql full course or any mysql tutorial that would cover mysql storage engines in more detail in all complex aspects?
A: Not that we know of, but if needed, we'll make a sql course talking about everything: sql basics, sql queries, sql vs nosql, sql for data analysis, etc.
Q: Is there a big data tutorial for those looking to work with big data on mysql server?
Q: I've heard that MyISAM performs row level locking?
A: No, that's a common misconception.
Q: MyISAM vs InnoDB performance - which one is better and why?
A: InnoDB - all of the features that were available in MyISAM are now available in InnoDB.
Q: What types of SQL indexes exist?
A: There are B-Tree indexes, R-Tree indexes, hash indexes, covering indexes, clustered indexes, multicolumn or composite SQL indexes, and prefix indexes.
Q: What is the most popular type of a mysql index?
A: A B-tree sql index is the most popular type of a mysql index.
Music:
Creative Commons — Attribution 3.0 Unported — CC BY 3.0
#shorts #reels #database #mysql