Skip to content

Commit

Permalink
docs: show create database (#1284)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengjiachun authored Nov 14, 2024
1 parent e23e36f commit 6e30d9f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
22 changes: 21 additions & 1 deletion docs/reference/sql/show.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ SHOW DATABASES WHERE Schemas='test_public_schema';
Show all databases with options:

```sql
create database with(ttl='7d');
CREATE DATABASE test WITH(ttl='7d');
SHOW FULL DATABASES;
```

Expand All @@ -49,6 +49,26 @@ SHOW FULL DATABASES;
+--------------------+-------------+
```

## SHOW CREATE DATABASE

Shows the `CREATE DATABASE` statement that creates the named database:

```sql
SHOW CREATE DATABASE test;
```

```sql
+----------+------------------------------------------------------------+
| Database | Create Database |
+----------+------------------------------------------------------------+
| test | CREATE DATABASE IF NOT EXISTS test
WITH(
ttl = '7days'
) |
+----------+------------------------------------------------------------+
1 row in set (0.01 sec)
```

## SHOW TABLES

Show all tables:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ SHOW DATABASES WHERE Schemas='test_public_schema';
展示所有数据库,包括它们的选项:

```sql
create database with(ttl='7d');
CREATE DATABASE test WITH(ttl='7d');
SHOW FULL DATABASES;
```

Expand All @@ -49,6 +49,26 @@ SHOW FULL DATABASES;
+--------------------+-------------+
```

## SHOW CREATE DATABASE

展示创建指定数据库的 `CREATE DATABASE` 语句:

```sql
SHOW CREATE DATABASE test;
```

```sql
+----------+------------------------------------------------------------+
| Database | Create Database |
+----------+------------------------------------------------------------+
| test | CREATE DATABASE IF NOT EXISTS test
WITH(
ttl = '7days'
) |
+----------+------------------------------------------------------------+
1 row in set (0.01 sec)
```

## SHOW TABLES

展示所有表:
Expand Down

0 comments on commit 6e30d9f

Please sign in to comment.