如何獲取 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.