上传文件至 /

This commit is contained in:
2025-11-14 13:24:53 +08:00
parent 7b8fb537cb
commit 3e2c103361
5 changed files with 127 additions and 0 deletions

29
数据库4.2.md Normal file
View File

@@ -0,0 +1,29 @@
# 一、表的创建(重点)
语法:
```sql
create table (
1 1 [],
2 2 [],
...
n n []
#
FOREIGN KEY () REFERENCE ()
#
PRIMARY KEY(1, 2)
) [];
```
# 二、 表的查看
语法:
`show tables;`显示当前数据库中所有的表(列表形式)
`desc [表名];` 显示表结构
`show columns from [表名]` 显示表结构
`show create table [表名]` 显示表结构
# 三、约束条件
1. 主键约束 primary key
2. 唯一约束 unique
3. 非空约束 not null
4. 默认值约束 default
5. 外键约束 foreign key