Skip to content

Commit

Permalink
修复ci,添加07
Browse files Browse the repository at this point in the history
  • Loading branch information
Leetfs committed Oct 8, 2024
1 parent de514a9 commit 18a0842
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ jobs:

# 第四步:构建项目
- name: 构建项目
run: pnpm run docs:build

run: pnpm dev
# 第五步:安装 Wrangler
- name: 安装 Wrangler
run: pnpm add -g wrangler@3
Expand Down
87 changes: 86 additions & 1 deletion docs/sql/06/xiugai.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,91 @@
title: 修改表
---

## 定义

```sql
alter table 表名
```

## 改名

### 更改表名

```sql
exec sp_rename oldname,newname
```

### 更改列名

```sql
exec sp_rename 'BiaoMing.oldname',newname
```

## 添加/删除

### 向表内添加一列Cellphone

```sql
alter table Cuetomer
add Cellphone char(10)
```

### 删除Cuetomer表的Cellphone列

```sql
alter table Cuetomer
drop column Cellphone
```

## 修改列

### 修改列的数据类型

```sql
alter table 表名
alter column 表名 数据类型
```

```
### 修改某列是否允许为空

```sql
alter table Cuetomer
alter column Cellphone char(11) not null
```

### 向Cuetomer表的CuetomerName列添加一个名为c1的唯一键约束

```sql
alter table Cuetomer
add constraint c1 unique(CuetomerName)
```

## 约束

### 给表加一个唯一键约束

```sql
alter table Cuetomer
add unique(CuetomerName)
```

### 向Cuetomer表的sex列添加一个名为df_sex的约束,要求默认值为they

```sql
alter table Cuetomer
add constraint df_sex unique(sex) deflut 'they'
```

### 删除约束df_sex

```sql
alter table Cuetomer
drop constraint df_sex
```

也可以写为

```sql
alter table Cuetomer
drop df_sex
```
4 changes: 4 additions & 0 deletions docs/sql/07/1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: 添加记录
---

5 changes: 5 additions & 0 deletions docs/sql/07/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 07.数据的输入与维护
---

电脑端在左侧-侧边栏查看文档,手机端点击左上角`菜单`

0 comments on commit 18a0842

Please sign in to comment.