-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from GuoXiCheng/dev-c
update docs
- Loading branch information
Showing
4 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Delete 语句 | ||
|
||
Delete 语句用于删除表中已有的记录。 | ||
|
||
可以使用带有 Where 子句的 Delete 语句删除选定的行,否则所有记录都会被删除。 | ||
|
||
## 删除所有行 | ||
|
||
::: code-group | ||
|
||
```sql [语法] | ||
DELETE FROM TABLE_NAME; | ||
``` | ||
|
||
```sql [实例] | ||
DELETE FROM customers; | ||
``` | ||
|
||
::: | ||
|
||
## 删除指定行 | ||
|
||
::: code-group | ||
|
||
```sql [语法] | ||
DELETE FROM TABLE_NAME | ||
WHERE condition; | ||
``` | ||
|
||
```sql [实例] | ||
DELETE FROM customers | ||
WHERE id = 1; | ||
``` | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Insert 语句 | ||
|
||
## 为所有列插入值 | ||
|
||
::: code-group | ||
|
||
```sql [语法] | ||
INSERT INTO TABLE_NAME | ||
VALUES (value1, value2, value3, ...); | ||
``` | ||
|
||
```sql [实例] | ||
INSERT INTO customers | ||
VALUES (1, 'John', 'Doe', '2021-01-01 00:00:00', '2021-01-01 00:00:00'); | ||
``` | ||
|
||
::: | ||
|
||
## 为指定列插入值 | ||
|
||
::: code-group | ||
|
||
```sql [语法] | ||
INSERT INTO TABLE_NAME (column1, column2, column3, ...) | ||
VALUES (value1, value2, value3, ...); | ||
``` | ||
|
||
```sql [实例] | ||
INSERT INTO customers (id, first_name, last_name, created_at, updated_at) | ||
VALUES (1, 'John', 'Doe', '2021-01-01 00:00:00', '2021-01-01 00:00:00'); | ||
``` | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Update 语句 | ||
|
||
Update 语句用于更新数据库表中的数据。 | ||
|
||
可以使用带有 WHERE 子句的 Update 语句来更新特定的行,否则所有行都会被更新。 | ||
|
||
## 更新所有行 | ||
|
||
::: code-group | ||
|
||
```sql [语法] | ||
UPDATE TABLE_NAME | ||
SET column1 = value1, column2 = value2, ... | ||
``` | ||
|
||
```sql [实例] | ||
UPDATE customers | ||
SET first_name = 'Jane', last_name = 'Doe'; | ||
``` | ||
|
||
::: | ||
|
||
## 更新指定行 | ||
|
||
::: code-group | ||
|
||
```sql [语法] | ||
UPDATE TABLE_NAME | ||
SET column1 = value1, column2 = value2, ... | ||
WHERE condition; | ||
``` | ||
|
||
```sql [实例] | ||
UPDATE customers | ||
SET first_name = 'Jane', last_name = 'Doe' | ||
WHERE id = 1; | ||
``` | ||
|
||
::: |