From 5f1baf12468fb2587ccb2d6e41df71cf494ce7d0 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 0b01ca64d2f85..441b4f12ff5be 100644 --- a/sql-statements/sql-statement-show-tables.md +++ b/sql-statements/sql-statement-show-tables.md @@ -6,27 +6,20 @@ aliases: ['/docs/dev/sql-statements/sql-statement-show-tables/','/docs/dev/refer # 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 04055cbf375c1996723d922e1bdb871fe1341f1c 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 441b4f12ff5be..90e405c3d5b72 100644 --- a/sql-statements/sql-statement-show-tables.md +++ b/sql-statements/sql-statement-show-tables.md @@ -85,3 +85,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 3d5ef180eeb832fb5948838216cab0063263fbdb 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 90e405c3d5b72..f41f6bc44d6ee 100644 --- a/sql-statements/sql-statement-show-tables.md +++ b/sql-statements/sql-statement-show-tables.md @@ -6,7 +6,7 @@ aliases: ['/docs/dev/sql-statements/sql-statement-show-tables/','/docs/dev/refer # 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`. @@ -85,4 +85,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)