Merge pull request #156 from Lukas2112/update02

[mysql] Add the "CONNECT" command and minor changes.
This commit is contained in:
Randy8080 authored and GitHub committed 2022-02-07 13:59:44 +08:00
commit 40a6cecda9
1 file changed
+5 -3
+5 -3
View File
@@ -40,6 +40,7 @@ mysql -h <host> -u <user> -p [db_name]
| `CREATE DATABASE` db `;` | Create database |
| `SHOW DATABASES;` | List databases |
| `USE` db`;` | Switch to db |
| `CONNECT` db `;` | Switch to db |
| `DROP DATABASE` db`;` | Delete db |
#### Table
@@ -47,7 +48,7 @@ mysql -h <host> -u <user> -p [db_name]
| - | - |
|--------------------------|----------------------------|
| `SHOW TABLES;` | List tables for current db |
| `SHOW fields from` t`;` | List fields for a table |
| `SHOW FIELDS FROM` t`;` | List fields for a table |
| `DESC` t`;` | Show table structure |
| `SHOW CREATE TABLE `t`;` | Show create table sql |
| `TRUNCATE TABLE `t`;` | Remove all data in a table |
@@ -94,9 +95,10 @@ Create a new table with three columns
```sql
CREATE TABLE t (
id INT PRIMARY KEY,
name VARCHAR NOT NULL,
id INT,
name VARCHAR DEFAULT NOT NULL,
price INT DEFAULT 0
PRIMARY KEY(id)
);
```