高手速度出来啊!!!用oracle

来源:百度知道 编辑:UC知道 时间:2024/05/28 09:55:20
1.为course表的course_id字段创建索引course_id_idx。
2.为teacher表的teacher_id字段建立一个主键约束pk_teacher_id。
3.查询score表中grade值在60-80之间的所有记录。
4.创建一个名为stu_view的视图,选择student表中的stu_id 、name,以及score表中的grade字段。
Student(stu_id char(4),name char(8),gender char(2))
Score (stu_id char(4), course_id char(4), grade number(5,2))
5.为student表建立公用同义词stu_syn。
6.建立一个名为newsequence的序列,起始值为20,每次增值为5。
7.创建一个名称为stu_user的用户,口令为123,默认表空间为users,临时表空间为temp。
8.创建一个名称为normal_user的角色。
9.将对student表的查询、插入权限授予normal_user角色。
10.将normal_user角色授予stu_user用户。

1.CREATE INDEX course_id_idx ON course(course_id);

2.alter table teacher add constraint pk_teacher_id primary key (teacher_id);

3.SELECT * FROM SCORE WHERE SCORE.GRADE BETWEEN 60 AND 80;

4.create view stu_view as
select student.stu_id, student.name, score.grade
from student, score
where student.stu_id = score.stu_id(+);

5.create synonym stu_syn for student;

6.create sequence newsequence
start with 20 increment by 5;

7.create user stu_user
identified by 123
default tablespace users
temporary tablespace temp
quota 10m on users
password expire;

8.create role testrole1 identified using sys.dbms_output;

9.grant student_select, student_insert to normal_user;

10.grant normal_user to stu_user;

下次问这么多问题记得给分,没有100分就别发!