oracle plsql练习题-考核题

博客更新地址啦~,欢迎访问:https://jerryyuanj.github.io/blog

数据库脚本:

– Create table 学生信息
create table HAND_STUDENT
(
STUDENT_NO VARCHAR2(10) not null,
STUDENT_NAME VARCHAR2(20),
STUDENT_AGE NUMBER(2),
STUDENT_GENDER VARCHAR2(5)
);
– Add comments to the table
comment on table HAND_STUDENT
is ‘学生信息表’;
– Add comments to the columns
comment on column HAND_STUDENT.STUDENT_NO
is ‘学号’;
comment on column HAND_STUDENT.STUDENT_NAME
is ‘姓名’;
comment on column HAND_STUDENT.STUDENT_AGE
is ‘年龄’;
comment on column HAND_STUDENT.STUDENT_GENDER
is ‘性别’;
– Create/Recreate primary, unique and foreign key constraints
alter table HAND_STUDENT add primary key (STUDENT_NO);

– Create table 教师信息表
create table HAND_TEACHER
(
TEACHER_NO VARCHAR2(10) not null,
TEACHER_NAME VARCHAR2(20),
MANAGER_NO VARCHAR2(10)
);
– Add comments to the table
comment on table HAND_TEACHER
is ‘教师信息表’;
– Add comments to the columns
comment on column HAND_TEACHER.TEACHER_NO
is ‘教师编号’;
comment on column HAND_TEACHER.TEACHER_NAME
is ‘教师名称’;
comment on column HAND_TEACHER.MANAGER_NO
is ‘上级编号’;
– Create/Recreate primary, unique and foreign key constraints
alter table HAND_TEACHER add primary key (TEACHER_NO);

– Create table 课程信息表
create table HAND_COURSE
(
COURSE_NO VARCHAR2(10) not null,
COURSE_NAME VARCHAR2(20),
TEACHER_NO VARCHAR2(20) not null
);
– Add comments to the table
comment on table HAND_COURSE
is ‘课程信息表’;
– Add comments to the columns
comment on column HAND_COURSE.COURSE_NO
is ‘课程号’;
comment on column HAND_COURSE.COURSE_NAME
is ‘课程名称’;
comment on column HAND_COURSE.TEACHER_NO
is ‘教师编号’;
– Create/Recreate primary, unique and foreign key constraints
alter table HAND_COURSE add constraint PK_COURSE primary key (COURSE_NO, TEACHER_NO);

– Create table 成绩信息表
create table HAND_STUDENT_CORE
(
STUDENT_NO VARCHAR2(10) not null,
COURSE_NO VARCHAR2(10) not null,
CORE NUMBER(4,2)
);
– Add comments to the table
comment on table HAND_STUDENT_CORE
is ‘学生成绩表’;
– Add comments to the columns
comment on column HAND_STUDENT_CORE.STUDENT_NO
is ‘学号’;
comme

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值