数据库学生系统管理遇到下面这些问题!!

问题①:设计一个修改数据的问题(能够用到like和排序)

这里我设计的问题为

//对姓'王'的同学中并且年龄有18岁以上的学号加1000,并按成绩显示;
代码如下:

update student set stu_id +=1000 where stu_age in
(select top 10 stu_id from student,score
where stu_name like '王%' and stu_age>18 and student.stu_id=score.stu_id
order by score_grade);

运行结果显示:列名 'stu_id' 不明确。

哪里有问题,并告知解决方法.

问题②:

用我下面设置的表设计一个数据安全的问题(能够用到自主存取控制的授权或回收权限)用SQL实现,这里没有思路,求举个例子提供下思路.

创建学生表:

create table student
(
stu_id int primary key,
stu_name varchar(20) not null,
stu_age varchar(20)not null,
stu_sex varchar(10)not null,
);

drop table student;

insert into student(stu_id,stu_name,stu_age,stu_sex)
VALUES(1001,'王一',18,'男'),(1002,'李二',19,'男'),(1003,'刘三',19,'男'),(1004,'赵四',22,'女'),(1005,'范五',20,'女');

select stu_id,stu_name,stu_age,stu_sex from student;

创建教师表:

create table teacher
(
tea_id int primary key,
tea_name varchar(20) not null,
tea_age varchar(20) not null,
tea_sex varchar(10) not null,
);

insert into teacher(tea_id,tea_name,tea_age,tea_sex)
VALUES(1901,'夏一',50,'男'),(1902,'胡二',39,'男'),(1903,'樊三',40,'男'),(1904,'房四',32,'女'),(1905,'陈五',55,'男');

drop table teacher;

select tea_id,tea_name,tea_age,tea_sex from teacher;


创建课程表:

create table course
(
cour_id int primary key,
cour_name varchar(20) not null,
cour_time varchar(30) not null,
tea_id int not null,
foreign key(tea_id)references teacher(tea_id)
);

show create table course;
alter table course drop foreign key teac_id;

drop table course;

insert into course(cour_id,cour_name,tea_id,cour_time)
VALUES(151,'计算机',1901,'444h'),(152,'英语',1902,'320h'),(153,'高数',1904,'320h'),(154,'c语言',1903,'400h'),(155,'数据库',1905,'444h');

select cour_id,cour_name,tea_id,cour_time from course;

创建成绩表:

create table score
(
cour_id int not null,
stu_id varchar(20) not null,
primary key(cour_id,stu_id),
score_grade varchar(20) not null,
);

insert into score(cour_id,stu_id,score_grade)
VALUES(151,1001,88),(151,1002,88),(151,1003,80),(151,1004,85),(151,1005,70);
insert into score(cour_id,stu_id,score_grade)
VALUES(152,1001,92),(152,1002,78),(152,1003,80),(152,1004,78),(152,1005,88);
insert into score(cour_id,stu_id,score_grade)
VALUES(153,1001,70),(153,1002,89),(153,1003,88),(153,1004,70),(153,1005,90);
insert into score(cour_id,stu_id,score_grade)
VALUES(154,1001,78),(154,1002,90),(154,1003,70),(154,1004,68),(154,1005,89);
insert into score(cour_id,stu_id,score_grade)
VALUES(155,1001,88),(155,1002,88),(155,1003,78),(155,1004,80),(155,1005,87);

drop table score;

select cour_id,stu_id,score_grade from score;

创建信息表:

create table location
(
stu_id int not null,
stu_name varchar(20) not null,
loca_address varchar(20) not null,
foreign key(stu_id) references student(stu_id)
);

drop table location;

insert into location(stu_id,stu_name,loca_address)
VALUES(1001,'王一','江苏'),(1002,'李二','河北'),(1003,'刘三','河北'),(1004,'赵四','东北'),(1005,'范五','云南');

select stu_id,stu_name,loca_address from location;

可能是set student.stu_id+=1000或者是set score.stu_id+=1000,这个查询应该是两张表的多表查询,字段两张表都有可能就报id不明确吧