The show tables command lists the tables in the database you are using. In the example below:
- The show tables command is run on an empty database.
- A table is created.
- The show tables command is run again and the new table appears in the output.
- The table is dropped.
- The show tables command is run showing that the database is empty again.
mysql> show tables;
Empty set (0.00 sec)
mysql> create table andrews_table
-> (col1 varchar(10));
Query OK, 0 rows affected (0.07 sec)
mysql> show tables;
+------------------+
| Tables_in_Andrew |
+------------------+
| andrews_table |
+------------------+
1 row in set (0.00 sec)
mysql> drop table andrews_table;
Query OK, 0 rows affected (0.00 sec)
mysql> show tables;
Empty set (0.00 sec)
No comments:
Post a Comment