From 00af18030803ca5744afbecc81b2b0ba9e10c147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Tue, 9 Apr 2024 09:10:22 +0200 Subject: [PATCH 1/3] ebnf show tables --- sql-statements/sql-statement-show-tables.md | 23 +++++++-------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/sql-statements/sql-statement-show-tables.md b/sql-statements/sql-statement-show-tables.md index 3f5f9c4c9a171..9ccd60737e3af 100644 --- a/sql-statements/sql-statement-show-tables.md +++ b/sql-statements/sql-statement-show-tables.md @@ -5,27 +5,20 @@ summary: An overview of the usage of SHOW [FULL] TABLES for the TiDB database. # SHOW [FULL] TABLES -This statement shows a list of tables and views in the currently selected database. The optional keyword `FULL` indicates if a table is of type `BASE TABLE` or `VIEW`. +This statement shows a list of tables and views in the currently selected database. The optional keyword `FULL` indicates if a table is of type `BASE TABLE`, `SEQUENCE` or `VIEW`. To show tables in a different database, use `SHOW TABLES IN DatabaseName`. ## Synopsis -**ShowTablesStmt:** +```ebnf+diagram +ShowTableStmt ::= + "SHOW" "FULL"? "TABLES" ("FROM" Identifier | "IN" Identifier )? ShowLikeOrWhere? -![ShowTablesStmt](/media/sqlgram/ShowTablesStmt.png) - -**OptFull:** - -![OptFull](/media/sqlgram/OptFull.png) - -**ShowDatabaseNameOpt:** - -![ShowDatabaseNameOpt](/media/sqlgram/ShowDatabaseNameOpt.png) - -**ShowLikeOrWhereOpt:** - -![ShowLikeOrWhereOpt](/media/sqlgram/ShowLikeOrWhereOpt.png) +ShowLikeOrWhere ::= + "LIKE" SimpleExpr +| "WHERE" Expression +``` ## Examples From 043af19027d56558e8dff4ccea2a769116d8c388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Tue, 9 Apr 2024 09:12:19 +0200 Subject: [PATCH 2/3] Add I_S tables link --- sql-statements/sql-statement-show-tables.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sql-statements/sql-statement-show-tables.md b/sql-statements/sql-statement-show-tables.md index 9ccd60737e3af..9cc6b9d26ceb9 100644 --- a/sql-statements/sql-statement-show-tables.md +++ b/sql-statements/sql-statement-show-tables.md @@ -84,3 +84,4 @@ The `SHOW [FULL] TABLES` statement in TiDB is fully compatible with MySQL. If yo * [CREATE TABLE](/sql-statements/sql-statement-create-table.md) * [DROP TABLE](/sql-statements/sql-statement-drop-table.md) * [SHOW CREATE TABLE](/sql-statements/sql-statement-show-create-table.md) +* [`information_schema.tables`](/information-schema/information-schema-tables.md) From d8df7c9bf6a891ba93283da3243e5bf398142bd5 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Mon, 15 Apr 2024 12:39:16 +0800 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Grace Cai --- sql-statements/sql-statement-show-tables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql-statements/sql-statement-show-tables.md b/sql-statements/sql-statement-show-tables.md index 9cc6b9d26ceb9..f2cc8fa015687 100644 --- a/sql-statements/sql-statement-show-tables.md +++ b/sql-statements/sql-statement-show-tables.md @@ -5,7 +5,7 @@ summary: An overview of the usage of SHOW [FULL] TABLES for the TiDB database. # SHOW [FULL] TABLES -This statement shows a list of tables and views in the currently selected database. The optional keyword `FULL` indicates if a table is of type `BASE TABLE`, `SEQUENCE` or `VIEW`. +This statement shows a list of tables and views in the currently selected database. The optional keyword `FULL` indicates if a table is of type `BASE TABLE`, `SEQUENCE`, or `VIEW`. To show tables in a different database, use `SHOW TABLES IN DatabaseName`. @@ -84,4 +84,4 @@ The `SHOW [FULL] TABLES` statement in TiDB is fully compatible with MySQL. If yo * [CREATE TABLE](/sql-statements/sql-statement-create-table.md) * [DROP TABLE](/sql-statements/sql-statement-drop-table.md) * [SHOW CREATE TABLE](/sql-statements/sql-statement-show-create-table.md) -* [`information_schema.tables`](/information-schema/information-schema-tables.md) +* [`INFORMATION_SCHEMA.TABLES`](/information-schema/information-schema-tables.md)