1.建表

- PK: primary key (column is part of a pk)
- NN: not null (column is nullable)
- UQ: unique (column is part of a unique key)
- AI: auto increment (the column is auto incremented when rows are inserted)
[additional data type flags, depend on used data type]
- BIN: binary (if dt is a blob or similar, this indicates that is binary data, rather than text)
- UN: unsigned (for integer types, see docs: “10.2. Numeric Types”)
- ZF: zero fill (rather a display related flag, see docs: “10.2. Numeric Types”)
2.删除表记录
truncate table `数据库名`.`表名`;
本文详细介绍了SQL中创建表的语法,包括主键、非空、唯一等约束,并提供了删除表记录的方法。同时,文章涵盖了数据库管理和常用数据类型标识符的使用。
865

被折叠的 条评论
为什么被折叠?



