当前位置:首页 > 实验七 数据更新实验报告
实验七 数据更新试验步骤报告
市场营销152 08刘运良1620153968
实验前提:还原数据库student_MIS.
1.表中插入数据
操作7.1:向user_info表插入一条记录,user_id:李明,user_PWD:123456,user_des:管理员
insert user_info values ('李明','123456','管理员')
操作7.2:向student表插入一条记录,学号070201001,姓名为王小五,性别为男,出生日期为1990年9月9日,班级为会计11,其余字段为NULL或默认值
insert into student_info
(student_id,Student_Name,Student_Sex,Born_Date,ClassName,Telephone)
values('070201001','王小五','男','1990/09/09','会计','')
操作7.3:向course_info表插入一条记录,课程号1234,课程名为计算机基础,其余字段为NULL或默认值
insert into course_info (Course_No,Course_Name) values('1234','计算机基础')
操作7.4:向student_course_info表插入一条记录,课程号1234,学号070201001,其余字段为NULL或默认值
insert into student_course_info (Course_No,Student_ID) values('1234','070201001')
2.修改表中数据
操作7.5:修改studen_info表记录,将王小五的宿舍改为11栋402
update student_info set Address='11栋' where student_name='王小五'
操作7.6:修改student_course_info表记录,将学号0009的所有记录的成绩改为80
update student_course_info set Score=80 where student_id='0009'
操作7.7:修改student_course_info表记录,将课程号为0005,学号为0010的记录的成绩改为77
update student_course_info set Score=77 where Course_No=0005 and Student_ID=0010
3.删除表中数据
操作7.8:删除student_course_info表记录,将课程号为0005,学名为0010的记录删除
delete
from
student_course_info
where
Course_No=0005
and
Student_ID=0010
操作7.9:删除student_course_info表记录,将课程号为0005的记录删除
delete from student_course_info where Course_No=0005
共分享92篇相关文档