Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc]Add show tables help documentation #9568

Merged
merged 1 commit into from
May 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/.vuepress/sidebar/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ module.exports = [
"SHOW-STREAM-LOAD",
"SHOW-SYNC-JOB",
"SHOW-TABLE-ID",
"SHOW-TABLES",
"SHOW-TABLE-STATUS",
"SHOW-TABLET",
"SHOW-TRANSACTION",
Expand Down
1 change: 1 addition & 0 deletions docs/.vuepress/sidebar/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ module.exports = [
"SHOW-STREAM-LOAD",
"SHOW-SYNC-JOB",
"SHOW-TABLE-ID",
"SHOW-TABLES",
"SHOW-TABLE-STATUS",
"SHOW-TABLET",
"SHOW-TRANSACTION",
Expand Down
83 changes: 83 additions & 0 deletions docs/en/sql-manual/sql-reference/Show-Statements/SHOW-TABLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
{
"title": "SHOW-TABLES",
"language": "en"
}
---

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

## SHOW-TABLES

### Name

SHOW TABLES

### Description

This statement is used to display all tables under the current db

grammar:

```sql
SHOW TABLES [LIKE]
````

illustrate:

1. LIKE: Fuzzy query can be performed according to the table name

### Example

1. View all tables under DB

```sql
mysql> show tables;
+---------------------------------+
| Tables_in_demo |
+---------------------------------+
| ads_client_biz_aggr_di_20220419 |
| cmy1 |
| cmy2 |
| intern_theme |
| left_table |
+---------------------------------+
5 rows in set (0.00 sec)
````

2. Fuzzy query by table name

```sql
mysql> show tables like '%cm%';
+----------------+
| Tables_in_demo |
+----------------+
| cmy1 |
| cmy2 |
+----------------+
2 rows in set (0.00 sec)
````

### Keywords

SHOW, TABLES

### Best Practice

83 changes: 83 additions & 0 deletions docs/zh-CN/sql-manual/sql-reference/Show-Statements/SHOW-TABLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
{
"title": "SHOW-TABLES",
"language": "zh-CN"
}
---

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

## SHOW-TABLES

### Name

SHOW TABLES

### Description

该语句用于展示当前 db 下所有的 table

语法:

```sql
SHOW TABLES [LIKE]
```

说明:

1. LIKE:可按照表名进行模糊查询

### Example

1. 查看DB下所有表

```sql
mysql> show tables;
+---------------------------------+
| Tables_in_demo |
+---------------------------------+
| ads_client_biz_aggr_di_20220419 |
| cmy1 |
| cmy2 |
| intern_theme |
| left_table |
+---------------------------------+
5 rows in set (0.00 sec)
```

2. 按照表名进行模糊查询

```sql
mysql> show tables like '%cm%';
+----------------+
| Tables_in_demo |
+----------------+
| cmy1 |
| cmy2 |
+----------------+
2 rows in set (0.00 sec)
```

### Keywords

SHOW, TABLES

### Best Practice