MySQL Programming Question:
Download Job Interview Questions and Answers PDF
How To Show All Tables with "mysql"?
Answer:
If you want to see all the tables in a database, you run the non-SQL command "SHOW TABLES" at the "mysql" prompt. See the following tutorial exercise for example:
>cd mysqlin
>mysql -u root test
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 14 to server version: 5.0.24
mysql> SHOW TABLES;
<pre>+----------------+
| Tables_in_test |
+----------------+
| links |
+----------------+</pre>
1 row in set (0.01 sec)
The output shows you that there is only one table in the "test" database.
>cd mysqlin
>mysql -u root test
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 14 to server version: 5.0.24
mysql> SHOW TABLES;
<pre>+----------------+
| Tables_in_test |
+----------------+
| links |
+----------------+</pre>
1 row in set (0.01 sec)
The output shows you that there is only one table in the "test" database.
Download MySQL Programming Interview Questions And Answers
PDF
Previous Question | Next Question |
How To Use "mysql" to Run SQL Statements? | What Is "mysqlcheck"? |