From 77e753a9f6121a0f6b7903cdb1751587cec9e8d3 Mon Sep 17 00:00:00 2001 From: shivusondur Date: Fri, 23 Aug 2019 09:21:23 +0530 Subject: [PATCH 01/13] Updated the document details --- docs/sql-ref-syntax-aux-show-tables.md | 31 +++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/sql-ref-syntax-aux-show-tables.md b/docs/sql-ref-syntax-aux-show-tables.md index e4340d608bf5..981dd74bd894 100644 --- a/docs/sql-ref-syntax-aux-show-tables.md +++ b/docs/sql-ref-syntax-aux-show-tables.md @@ -18,5 +18,34 @@ license: | See the License for the specific language governing permissions and limitations under the License. --- +### Description +Return all tables form the database. It shows databse name and whether a table is temporary. + +### Syntax +{% highlight sql %} +SHOW TABLES [{FROM|IN} dbname] [LIKE 'pattern'] +{% endhighlight %} + +### Parameter + + **dbname** + + All the tables from this *Database* are returned, if not provided it takes the current *Database*. + + **FROM** or **IN** + + Return all tables from or in a database. + + **LIKE 'pattern'** + + Returns tables which are all match the pattern. In pattern '*' matches any number of characters. + + +### Example +{% highlight sql %} +SHOW TABLES +SHOW TABLES FROM userdb +SHOW TABLES IN userdb +SHOW TABLES FROM userdb LIKE employeedb* +{% endhighlight %} -**This page is under construction** From 517816094d99b1bbb4577d85ec9dec225085bc62 Mon Sep 17 00:00:00 2001 From: shivusondur Date: Mon, 2 Sep 2019 16:07:56 +0530 Subject: [PATCH 02/13] Updated the document according to latest comments --- docs/sql-ref-syntax-aux-show-tables.md | 73 ++++++++++++++++++++------ 1 file changed, 56 insertions(+), 17 deletions(-) diff --git a/docs/sql-ref-syntax-aux-show-tables.md b/docs/sql-ref-syntax-aux-show-tables.md index 981dd74bd894..ccf8a4c1565e 100644 --- a/docs/sql-ref-syntax-aux-show-tables.md +++ b/docs/sql-ref-syntax-aux-show-tables.md @@ -19,33 +19,72 @@ license: | limitations under the License. --- ### Description -Return all tables form the database. It shows databse name and whether a table is temporary. + +List all the `tables` from the database with `database-name` and `is temporary table`. ### Syntax {% highlight sql %} -SHOW TABLES [{FROM|IN} dbname] [LIKE 'pattern'] +SHOW TABLES [{FROM|IN} database_name] [LIKE 'regex_pattern'] {% endhighlight %} ### Parameter +
+
{FROM|IN} database_name
+
+ Listing the tables from this `database`. +
+
LIKE 'regex_pattern'
+
+ A regex pattern that is used to filter out unwanted functions. +
- Only `*` and `|` are allowed as wildcard pattern. +
- Excluding `*` and `|` the remaining pattern follows the regex semantics. +
- The leading and trailing blanks are trimmed in the input pattern before processing. +
+
- **dbname** - - All the tables from this *Database* are returned, if not provided it takes the current *Database*. - - **FROM** or **IN** - - Return all tables from or in a database. +### Example +{% highlight sql %} +-- List all tables in default database +SHOW TABLES; ++-----------+------------+--------------+--+ +| database | tableName | isTemporary | ++-----------+------------+--------------+--+ +| default | sam | false | +| default | sam1 | false | +| default | suj | false | ++-----------+------------+--------------+--+ - **LIKE 'pattern'** +-- List all tables from userdb database +SHOW TABLES FROM userdb; ++-----------+------------+--------------+--+ +| database | tableName | isTemporary | ++-----------+------------+--------------+--+ +| userdb | user1 | false | +| userdb | user2 | false | ++-----------+------------+--------------+--+ - Returns tables which are all match the pattern. In pattern '*' matches any number of characters. +-- List all tables in userdb database +SHOW TABLES IN userdb; ++-----------+------------+--------------+--+ +| database | tableName | isTemporary | ++-----------+------------+--------------+--+ +| userdb | user1 | false | +| userdb | user2 | false | ++-----------+------------+--------------+--+ +-- List all tables from default database matching the pattern `sam*` +SHOW TABLES FROM default LIKE 'sam*'; ++-----------+------------+--------------+--+ +| database | tableName | isTemporary | ++-----------+------------+--------------+--+ +| default | sam | false | +| default | sam1 | false | ++-----------+------------+--------------+--+ -### Example -{% highlight sql %} -SHOW TABLES -SHOW TABLES FROM userdb -SHOW TABLES IN userdb -SHOW TABLES FROM userdb LIKE employeedb* {% endhighlight %} +### Related statements. +- [CREATE TABLE ](sql-ref-syntax-ddl-create-table.html) +- [DROP TABLE ](ssql-ref-syntax-ddl-drop-table.html) +- [CREATE DATABASE](sql-ref-syntax-ddl-create-database.html) +- [DROP DATABASE](sql-ref-syntax-ddl-drop-database.html) \ No newline at end of file From 19f39fcfad436a7a6016005910e0c55f998a8950 Mon Sep 17 00:00:00 2001 From: shivusondur Date: Sat, 21 Sep 2019 16:39:16 +0530 Subject: [PATCH 03/13] 1. changed to "Parameters" 2. Changed to "unwanted tables" 3. Added the "two space align in the result" 4. removed the period in "statements" 5. verified the links in the Related statements --- docs/sql-ref-syntax-aux-show-tables.md | 62 +++++++++++++------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/sql-ref-syntax-aux-show-tables.md b/docs/sql-ref-syntax-aux-show-tables.md index ccf8a4c1565e..dd84cc8f10c4 100644 --- a/docs/sql-ref-syntax-aux-show-tables.md +++ b/docs/sql-ref-syntax-aux-show-tables.md @@ -27,15 +27,15 @@ List all the `tables` from the database with `database-name` and `is temporary t SHOW TABLES [{FROM|IN} database_name] [LIKE 'regex_pattern'] {% endhighlight %} -### Parameter +### Parameters
{FROM|IN} database_name
- Listing the tables from this `database`. + Specifies the `database` name from which tables are listed.
LIKE 'regex_pattern'
- A regex pattern that is used to filter out unwanted functions. + Specifies the regex pattern that is used to filter out unwanted tables.
- Only `*` and `|` are allowed as wildcard pattern.
- Excluding `*` and `|` the remaining pattern follows the regex semantics.
- The leading and trailing blanks are trimmed in the input pattern before processing. @@ -46,45 +46,45 @@ SHOW TABLES [{FROM|IN} database_name] [LIKE 'regex_pattern'] {% highlight sql %} -- List all tables in default database SHOW TABLES; -+-----------+------------+--------------+--+ -| database | tableName | isTemporary | -+-----------+------------+--------------+--+ -| default | sam | false | -| default | sam1 | false | -| default | suj | false | -+-----------+------------+--------------+--+ + +-----------+------------+--------------+--+ + | database | tableName | isTemporary | + +-----------+------------+--------------+--+ + | default | sam | false | + | default | sam1 | false | + | default | suj | false | + +-----------+------------+--------------+--+ -- List all tables from userdb database SHOW TABLES FROM userdb; -+-----------+------------+--------------+--+ -| database | tableName | isTemporary | -+-----------+------------+--------------+--+ -| userdb | user1 | false | -| userdb | user2 | false | -+-----------+------------+--------------+--+ + +-----------+------------+--------------+--+ + | database | tableName | isTemporary | + +-----------+------------+--------------+--+ + | userdb | user1 | false | + | userdb | user2 | false | + +-----------+------------+--------------+--+ -- List all tables in userdb database SHOW TABLES IN userdb; -+-----------+------------+--------------+--+ -| database | tableName | isTemporary | -+-----------+------------+--------------+--+ -| userdb | user1 | false | -| userdb | user2 | false | -+-----------+------------+--------------+--+ + +-----------+------------+--------------+--+ + | database | tableName | isTemporary | + +-----------+------------+--------------+--+ + | userdb | user1 | false | + | userdb | user2 | false | + +-----------+------------+--------------+--+ -- List all tables from default database matching the pattern `sam*` SHOW TABLES FROM default LIKE 'sam*'; -+-----------+------------+--------------+--+ -| database | tableName | isTemporary | -+-----------+------------+--------------+--+ -| default | sam | false | -| default | sam1 | false | -+-----------+------------+--------------+--+ + +-----------+------------+--------------+--+ + | database | tableName | isTemporary | + +-----------+------------+--------------+--+ + | default | sam | false | + | default | sam1 | false | + +-----------+------------+--------------+--+ {% endhighlight %} -### Related statements. -- [CREATE TABLE ](sql-ref-syntax-ddl-create-table.html) -- [DROP TABLE ](ssql-ref-syntax-ddl-drop-table.html) +### Related statements +- [CREATE TABLE](sql-ref-syntax-ddl-create-table.html) +- [DROP TABLE](sql-ref-syntax-ddl-drop-table.html) - [CREATE DATABASE](sql-ref-syntax-ddl-create-database.html) - [DROP DATABASE](sql-ref-syntax-ddl-drop-database.html) \ No newline at end of file From 55ea2cf1c6bf07e9d033a78f762bae42968bfe4c Mon Sep 17 00:00:00 2001 From: shivusondur Date: Sun, 22 Sep 2019 09:02:39 +0530 Subject: [PATCH 04/13] 1. Added the one more example to demonstrate the "|" wild card --- docs/sql-ref-syntax-aux-show-tables.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/sql-ref-syntax-aux-show-tables.md b/docs/sql-ref-syntax-aux-show-tables.md index dd84cc8f10c4..2e8830f4107c 100644 --- a/docs/sql-ref-syntax-aux-show-tables.md +++ b/docs/sql-ref-syntax-aux-show-tables.md @@ -80,6 +80,15 @@ SHOW TABLES FROM default LIKE 'sam*'; | default | sam | false | | default | sam1 | false | +-----------+------------+--------------+--+ +-- List all tables matching the pattern `sam*|suj` +SHOW TABLES LIKE 'sam*|suj'; + +-----------+------------+--------------+--+ + | database | tableName | isTemporary | + +-----------+------------+--------------+--+ + | default | sam | false | + | default | sam1 | false | + | default | suj | false | + +-----------+------------+--------------+--+ {% endhighlight %} From 0dd4efb71e8a921cc0c57534fc8492803a8b65be Mon Sep 17 00:00:00 2001 From: shivusondur Date: Sun, 22 Sep 2019 14:05:20 +0530 Subject: [PATCH 05/13] Added the space between examples --- docs/sql-ref-syntax-aux-show-tables.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/sql-ref-syntax-aux-show-tables.md b/docs/sql-ref-syntax-aux-show-tables.md index 2e8830f4107c..3f5f31941ba7 100644 --- a/docs/sql-ref-syntax-aux-show-tables.md +++ b/docs/sql-ref-syntax-aux-show-tables.md @@ -80,6 +80,7 @@ SHOW TABLES FROM default LIKE 'sam*'; | default | sam | false | | default | sam1 | false | +-----------+------------+--------------+--+ + -- List all tables matching the pattern `sam*|suj` SHOW TABLES LIKE 'sam*|suj'; +-----------+------------+--------------+--+ From 1d08b225f23e382390e95a07ce09eddb6e57cc53 Mon Sep 17 00:00:00 2001 From: shivusondur Date: Mon, 23 Sep 2019 06:10:36 +0530 Subject: [PATCH 06/13] Updated the description --- docs/sql-ref-syntax-aux-show-tables.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/sql-ref-syntax-aux-show-tables.md b/docs/sql-ref-syntax-aux-show-tables.md index 3f5f31941ba7..9c7a6e6ebd63 100644 --- a/docs/sql-ref-syntax-aux-show-tables.md +++ b/docs/sql-ref-syntax-aux-show-tables.md @@ -20,7 +20,10 @@ license: | --- ### Description -List all the `tables` from the database with `database-name` and `is temporary table`. +`SHOW TABLES` statement returns all the tables for an optionally specified `database`. +Additionally, the output of this statement may be filtered via an optional matching +pattern. If no database is specified then the tables are returned from the +current database. ### Syntax {% highlight sql %} From 847fb8ee3167a89c9796c435b38b46140080036a Mon Sep 17 00:00:00 2001 From: shivusondur Date: Tue, 1 Oct 2019 23:50:08 +0530 Subject: [PATCH 07/13] Updated the description --- docs/sql-ref-syntax-aux-show-tables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sql-ref-syntax-aux-show-tables.md b/docs/sql-ref-syntax-aux-show-tables.md index 9c7a6e6ebd63..a7db3dfb66f5 100644 --- a/docs/sql-ref-syntax-aux-show-tables.md +++ b/docs/sql-ref-syntax-aux-show-tables.md @@ -39,8 +39,8 @@ SHOW TABLES [{FROM|IN} database_name] [LIKE 'regex_pattern']
LIKE 'regex_pattern'
Specifies the regex pattern that is used to filter out unwanted tables. -
- Only `*` and `|` are allowed as wildcard pattern. -
- Excluding `*` and `|` the remaining pattern follows the regex semantics. +
- The pattern is a regex except that `*` and `|`characters +
- `*` matches 0 or more characters and `|` used to provide more than one regex with OR condition
- The leading and trailing blanks are trimmed in the input pattern before processing.
From 05a2e600c48f934864da0224694f5572cbb62b13 Mon Sep 17 00:00:00 2001 From: shivusondur Date: Thu, 3 Oct 2019 23:25:10 +0530 Subject: [PATCH 08/13] handled the comments --- docs/sql-ref-syntax-aux-show-tables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sql-ref-syntax-aux-show-tables.md b/docs/sql-ref-syntax-aux-show-tables.md index a7db3dfb66f5..b9cbccb1d5cc 100644 --- a/docs/sql-ref-syntax-aux-show-tables.md +++ b/docs/sql-ref-syntax-aux-show-tables.md @@ -20,8 +20,8 @@ license: | --- ### Description -`SHOW TABLES` statement returns all the tables for an optionally specified `database`. -Additionally, the output of this statement may be filtered via an optional matching +The `SHOW TABLES` statement returns all the tables for an optionally specified `database`. +Additionally, the output of this statement may be filtered by an optional matching pattern. If no database is specified then the tables are returned from the current database. From fed9431529a9b1eeb9b709d56902f24ef62fc0dc Mon Sep 17 00:00:00 2001 From: shivusondur Date: Mon, 7 Oct 2019 09:54:28 +0530 Subject: [PATCH 09/13] handled the comments --- docs/sql-ref-syntax-aux-show-tables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sql-ref-syntax-aux-show-tables.md b/docs/sql-ref-syntax-aux-show-tables.md index b9cbccb1d5cc..7e3a3363f6d1 100644 --- a/docs/sql-ref-syntax-aux-show-tables.md +++ b/docs/sql-ref-syntax-aux-show-tables.md @@ -20,7 +20,7 @@ license: | --- ### Description -The `SHOW TABLES` statement returns all the tables for an optionally specified `database`. +The `SHOW TABLES` statement returns all the tables for an optionally specified database. Additionally, the output of this statement may be filtered by an optional matching pattern. If no database is specified then the tables are returned from the current database. @@ -39,7 +39,7 @@ SHOW TABLES [{FROM|IN} database_name] [LIKE 'regex_pattern']
LIKE 'regex_pattern'
Specifies the regex pattern that is used to filter out unwanted tables. -
- The pattern is a regex except that `*` and `|`characters +
- The pattern is a regex except `*` and `|`characters
- `*` matches 0 or more characters and `|` used to provide more than one regex with OR condition
- The leading and trailing blanks are trimmed in the input pattern before processing.
From 83cff5d63d4e053ee216a638751be10e0b7279eb Mon Sep 17 00:00:00 2001 From: shivusondur Date: Wed, 9 Oct 2019 10:00:11 +0530 Subject: [PATCH 10/13] handled the comments --- docs/sql-ref-syntax-aux-show-tables.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/sql-ref-syntax-aux-show-tables.md b/docs/sql-ref-syntax-aux-show-tables.md index 7e3a3363f6d1..780d166d9167 100644 --- a/docs/sql-ref-syntax-aux-show-tables.md +++ b/docs/sql-ref-syntax-aux-show-tables.md @@ -38,10 +38,13 @@ SHOW TABLES [{FROM|IN} database_name] [LIKE 'regex_pattern']
LIKE 'regex_pattern'
- Specifies the regex pattern that is used to filter out unwanted tables. -
- The pattern is a regex except `*` and `|`characters -
- `*` matches 0 or more characters and `|` used to provide more than one regex with OR condition -
- The leading and trailing blanks are trimmed in the input pattern before processing. + Specifies the regular expression pattern that is used to filter out unwanted tables. +
    +
  • Except `*` and `|` characters remaining characters will follow the regular expression convention.
  • +
  • `*` matches 0 or more characters and `|` used to provide more than one regex with OR condition.
  • +
  • The leading and trailing blanks are trimmed in the input pattern before processing.
  • +
+
From f3e1c312f7f60d2cfee44d00e7e9b47b9b13dc6c Mon Sep 17 00:00:00 2001 From: shivusondur Date: Thu, 10 Oct 2019 09:24:51 +0530 Subject: [PATCH 11/13] handled the comments --- docs/sql-ref-syntax-aux-show-tables.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/sql-ref-syntax-aux-show-tables.md b/docs/sql-ref-syntax-aux-show-tables.md index 780d166d9167..f1b30f104eb8 100644 --- a/docs/sql-ref-syntax-aux-show-tables.md +++ b/docs/sql-ref-syntax-aux-show-tables.md @@ -34,14 +34,15 @@ SHOW TABLES [{FROM|IN} database_name] [LIKE 'regex_pattern']
{FROM|IN} database_name
- Specifies the `database` name from which tables are listed. + Specifies the database name from which tables are listed.
-
LIKE 'regex_pattern'
+
LIKE regex_pattern
Specifies the regular expression pattern that is used to filter out unwanted tables.
    -
  • Except `*` and `|` characters remaining characters will follow the regular expression convention.
  • -
  • `*` matches 0 or more characters and `|` used to provide more than one regex with OR condition.
  • +
  • Except for * and | character, the pattern works like a regex
  • +
  • * alone matches 0 or more characters and | is used to separate multiple different regexes, + any of which can match
  • The leading and trailing blanks are trimmed in the input pattern before processing.
From 8e1e114d7ef83317166e276030649d6f52fceeb9 Mon Sep 17 00:00:00 2001 From: shivusondur Date: Thu, 10 Oct 2019 09:34:10 +0530 Subject: [PATCH 12/13] handled the comments --- docs/sql-ref-syntax-aux-show-tables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sql-ref-syntax-aux-show-tables.md b/docs/sql-ref-syntax-aux-show-tables.md index f1b30f104eb8..6948556163ca 100644 --- a/docs/sql-ref-syntax-aux-show-tables.md +++ b/docs/sql-ref-syntax-aux-show-tables.md @@ -40,9 +40,9 @@ SHOW TABLES [{FROM|IN} database_name] [LIKE 'regex_pattern']
Specifies the regular expression pattern that is used to filter out unwanted tables.
    -
  • Except for * and | character, the pattern works like a regex
  • +
  • Except for * and | character, the pattern works like a regex.
  • * alone matches 0 or more characters and | is used to separate multiple different regexes, - any of which can match
  • + any of which can match.
  • The leading and trailing blanks are trimmed in the input pattern before processing.
From e26f55bcf7cfa3be83cec8586116d18a0b3d1791 Mon Sep 17 00:00:00 2001 From: shivusondur Date: Fri, 11 Oct 2019 09:17:06 +0530 Subject: [PATCH 13/13] handled the comments --- docs/sql-ref-syntax-aux-show-tables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sql-ref-syntax-aux-show-tables.md b/docs/sql-ref-syntax-aux-show-tables.md index 6948556163ca..46cfe40dc260 100644 --- a/docs/sql-ref-syntax-aux-show-tables.md +++ b/docs/sql-ref-syntax-aux-show-tables.md @@ -40,8 +40,8 @@ SHOW TABLES [{FROM|IN} database_name] [LIKE 'regex_pattern']
Specifies the regular expression pattern that is used to filter out unwanted tables.
    -
  • Except for * and | character, the pattern works like a regex.
  • -
  • * alone matches 0 or more characters and | is used to separate multiple different regexes, +
  • Except for `*` and `|` character, the pattern works like a regex.
  • +
  • `*` alone matches 0 or more characters and `|` is used to separate multiple different regexes, any of which can match.
  • The leading and trailing blanks are trimmed in the input pattern before processing.