如何獲取預設 MySQL 資料庫中的表列表?


眾所周知,預設的 MySQL 資料庫是後續查詢時當前使用的資料庫。我們可以使用 SHOW TABLES 語句獲取該資料庫中的表格列表。

mysql> SHOW TABLES;

+------------------+
| Tables_in_sample |
+------------------+
| employee         |
| new_student      |
| student          |
+------------------+

3 rows in set (0.00 sec)

上述語句顯示了 Sample 資料庫中的表格列表。

更新於: 2019 年 7 月 30 日

372 次瀏覽

開啟你的 職業生涯

完成課程以獲得認證

立即開始
廣告
© . All rights reserved.