实验十二 更新语句
一. 实验目的
1. 熟悉使用UPDATE/INSERT/DELETE语句进行表操作;
2. 能将这些更新操作应用于实际操作中去;
二.
三. 实验准备 实验要求 1.了解这些更新语句的基本语法和用法;
1. 完成下面的实验内容,并提交实验报告;
2. 在实验报告中附上相应的代码;
四. 实验内容
1. 对于student表,将所有专业号为‘001’的,并且入学年份为2006的学生,或是专业号为‘003’,并且年龄小于20岁的学生的班级号改为‘001’。
2. 对于student表,删掉所有年龄小于20岁,并且专业号为‘003’的学生的记录。
3. 对于student表,插入一条新记录,它的具体信息为,学号:2007110011、姓名:张三、
性别:男、出生日期:19880808、院系编号:‘001’、专业编号:
‘001’、班级号:‘001’、入学时间:20070901。
第2 / 5页
4. 对于student表,将入学时间最晚的学生和年龄最小的学生的联系方式去掉。
(1) select*
from student
where entime>=all(select entime from student)
or birthday>=all(select birthday from student
)
(2)
delete from student
where entime>=all(select entime from student)
or birthday>=all(select birthday from student)
第3 / 5页