You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.3 KiB

3 years ago
# 创建表的操作
创建表命令:
```mysql
# 创建管理员表
create table uses (
id int (10) auto_increment primary key not null,
number char(5) comment '账号',
iphone int(11) comment '手机号',
workType varchar(4) comment '工作岗位',
loginDate datetime,
loginNumber int(255)
);
# 查看表结构
desc uses;
# 查看表数据
select * from uses;
# 创建部门表
create table work(
id int(255) auto_increment primary key,
workId char(10) not null comment '部门ID',
workName varchar(5) comment '部门名称',
workCreate datetime,
workDescription varchar(255) comment '部门简介'
);
# 查询表
show tables;
# 删除表
drop table uses;
# 资产管理表
create table AssetInfo(
id int(255) auto_increment primary key comment '索引字段',
AssetId char(5) comment '资产编号',
AssetName varchar(10) comment '资产名称',
AssetType varchar(10) comment '资产类型',
AssetSupplier varchar(20) comment '供应商',
AssetBrand varchar(20) comment '品牌',
AssetMethod varchar(20) comment '取得方式',
AssetDate datetime comment '资产时间',
AssetAddress varchar(40) comment '存放地址',
AssetStatus char(10) comment '资产状态'
);
# 查看表结构
desc AssetInfo;
```