Help and Show Commands in MySQL

INTRODUCTION

 
In this tutorial, I am going to explain about the MySQL Help and Show Commands with examples.
 
In MySQL, we have to use many commands. Some commands are used to show statements. These commands provide general information related to our database. The output from the show table contains a column of table names. This statement lists any views in the database.
 
Below are some examples of help and show command with syntax that provide general information of our database and tables.
 

SHOW STATEMENTS

 
1) USE <database_name>;
 
2) Show databases list the databases name in MySQL.
 
Syntax:
 
a)
  1. SHOW DATABASES; 
 
b)
  1. SHOW DATABASES LIKE '%dml%'
 
3) SHOW TABLES FROM <database_name> LIKE <table_name>;
 
 
4) Show Tables lists the NON-TEMPORARY tables name from a given database.
 
Syntax:
  1. SHOW TABLES; 
 
5)
  1. USE order_by;  
  2.    
  3. SHOW COLUMNS FROM <table_name>; 
 

DESCRIBE

 
In MySQL, the describe command shows table functionality.
 
Syntax:
DESCRIBE <table_name>;
 
 

Help STATEMENTS

 
1)
  1. SELECT USER(), NOW(), VERSION(), DATABASE(); 
 
2)
  1. SHOW GRANTS FOR root@localhost; 
 
3)
  1. SHOW INDEX FROM emp_info; 
4)
  1. SHOW INDEX FROM emp_info FROM vatsa; 
5)
  1. SHOW PROCESSLIST; 
 

STATUS

 
In MySQL, the Status command is used to get the status information from the server.
 
1)
  1. SHOW STATUS ; 
 
2) SHOW TABLE STATUS FROM <database_name>;
 
 

VARIABLES

 
Show variables show the values of MySQL system variables. Show variable displays the values that are used for new connections to MySQL.
 
Syntax:
  1. SHOW VARIABLES; 
 

CONCLUSION

 
In this article, I have discussed the concept of MySQL Help and Show Commands with various examples.
 
I hope you enjoyed this article. Follow C# Corner to learn more new and amazing things about MySQL. 
 
Thanks for reading this article!