How To List MySQL Tables with “show tables” SQL Query

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/how-to-list-mysql-tables-with-show-tables-sql-query/
PINTEREST
PINTEREST
INSTAGRAM

MySQL stores given relation data in tables. While using tables we generally need to check and list existing tables. We can use different ways to list tables. In this tutorial we will learn how to use show tables and Select table_name in order to list and print table names.

Connect MySQL Interactive Shell

We need to connect or run command in MySQL to list table names. We will connect to the interactive MySQL server to run given commands. We will use mysql command to connect local or remote MySQL interactive shell.

Connect MySQL Interactive Shell
Connect MySQL Interactive Shell

Select Database

In order to run given SQL commands and queries we need to specify the database we want to work. We will use show databases and use DATABASENAME command.

Select Database
Select Database

show tables SQL Query

Now we will run or show tables query in this example. We can also use SHOW TABLES which is uppercase version and have same affect with lowercase version. Do not skip to add semicolon to the end of the command.

show tables SQL Query
show tables SQL Query

Show All Tables of MySQL Server with “Select table_name”  Query

We have another alternative to show tables query.  This will list all tables created in connected MySQL instance.

Show All Tables of MySQL Server with "Select table_name Query"
Show All Tables of MySQL Server with “Select table_name” Query

Show Tables Of Given Database with “Select table_name” Query

In this exmaple we will use Select table_name query but we will filter for given database by using where statement for table_name column. We will only list database named mysql in this example.

LEARN MORE  Display Detailed System Information With Systeminfo For Windows Operating Systems

Show Tables Of Given Database with "Select table_name" Query
Show Tables Of Given Database with “Select table_name” Query

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/how-to-list-mysql-tables-with-show-tables-sql-query/
PINTEREST
PINTEREST
INSTAGRAM