目录
二、向student表中添加一条新记录,记录中id字段的值为1,name字段的值为"monkey",grade字段的值为98.5
[四、向student表中添加一条新记录,部分数据插入: 5,"jone"](#四、向student表中添加一条新记录,部分数据插入: 5,"jone")
[五、更新表,grade 大于90的加0.5](#五、更新表,grade 大于90的加0.5)
二、用户权限部分1、创建一个用户test1使他只能本地登录拥有查询student表的权限。
一、在数据库中创建一个表student,用于存储学生信息
指令:
create table student(id int primary key,name varchar(20) not null,grade float);
演示:

二、向student表中添加一条新记录,记录中id字段的值为1,name字段的值为"monkey",grade字段的值为98.5
指令:
mysql> insert into student (id, name, grade) values (1, 'monkey', 98.5);
指令(查看数据库内容):
select * from student;
select id, name, grade from student;
演示:

三、向student表中添加多条新记录:
2,"bob",95.5
3,"john",90.0
4,"smith",88.5
指令:
mysql> insert into student
-> (id, name, grade) values
-> (2, 'bob', 95.5),
-> (3, 'john', 90.0),
-> (4, 'smith', 88.5);
演示:

四、向student表中添加一条新记录,部分数据插入:
5,"jone"
指令:
mysql> insert into student
-> (id, name) values (5, 'jone');
演示:

五、更新表,grade 大于90的加0.5
指令:
update student set grade = grade + 0.5 where grade > 90;
演示:

六、删除成绩为空的记录
指令:
delete from student where grade is null;
演示:

二、用户权限部分
1、创建一个用户test1使他只能本地登录拥有查询student表的权限。
CREATE USER 'test1'@'localhost' IDENTIFIED BY '123456';
grant select on MYSQL.student to test1@localhost;
演示:
2、查询用户test1的权限。
show grants for test1@localhost;
演示:
3、删除用户test1.
delete from user where user="test1";
drop user test1@localhost;
演示:
