create datebase db_xa
use db_xa
create table tblStudents
(
stuID char(8) not null primary key COMMENT '学号',
stuName char(4) not null COMMENT '姓名',
stuGender enum('男','女') not null COMMENT '性别',
departID tinyint COMMENT '系部编号'
)
insert into tblStudents values('20210001','曹操','男',1),('20210002','夏侯惇','男',1),('20210003','张辽','男',1),
('20210004','刘备','男',2),('20210005','于禁','男',1),('20210006','孙权','男',3),('20210007','周瑜','男',3),
(1) 创建用户xaUser ,密码111,可以从任意192.168局域网中连接数据库db_xa. 授权该用户具有在给定学号条件下更新stuname字段权限,如可以执行update tblstudents set stuname='aa' where stuid='20210001'