更新时间:2022-09-16 20:43:44
1 样例数据脚本位置
D:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN
2 查看scott用户下存在那些表
select * from all_tables where owner = 'SCOTT'
3 scott用户下各表机构及字段含义
(1)EMP:雇员表,记录了一个雇员的基本信息。
NO 字段 类型 描述
1 EMPNO NUMBER(4) 雇员编号
2 ENAME VARCHAR2(10) 表示雇员姓名
3 JOB VARCHAR2(9) 表示工作职位
4 MGR NUMBER(4) 表示一个雇员的领导编号
5 HIREDATE DATE 表示雇佣日期
6 SAL NUMBER(7,2) 表示月薪,工资
7 COMM NUMBER(7,2) 表示奖金或佣金
8 DEPTNO NUMBER(2) 表示部门编号
添加备注说明:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
comment on table scott.EMP
is '雇员表:记录了一个雇员的基本信息' ;
comment on column scott.EMP.EMPNO
is '雇员编号' ;
comment on column scott.EMP.ENAME
is '雇员姓名' ;
comment on column scott.EMP.JOB
is '工作职位' ;
comment on column scott.EMP.MGR
is '雇员的领导编号' ;
comment on column scott.EMP.HIREDATE
is '雇佣日期' ;
comment on column scott.EMP.SAL
is '月薪' ;
comment on column scott.EMP.COMM
is '奖金或佣金' ;
comment on column scott.EMP.DEPTNO
is '部门编号' ;
|
(2)DEPT:部门表,表示一个部门的具体信息。
NO 字段 类型 描述
1 DEPTNO NUMBER(2) 部门编号
2 DNAME VARCHAR2(14) 部门名称
3 LOC VARCHAR2(13) 部门位置
添加备注说明:
1
2
3
4
5
6
7
8
|
comment on table scott.DEPT
is '部门:表示一个部门的具体信息' ;
comment on column scott.DEPT.DEPTNO
is '部门编号' ;
comment on column scott.DEPT.DNAME
is '部门名称' ;
comment on column scott.DEPT.LOC
is '部门位置' ;
|
(3)BONUS:奖金表,表示一个雇员的工资及奖金。
NO 字段 类型 描述
1 ENAME VARCHAR2(10) 雇员姓名
2 JOB VARCHAR2(9) 雇员工作
3 SAL NUMBER 雇员工资
4 COMM NUMBER 雇员奖金
添加备注说明:
1
2
3
4
5
6
7
8
9
10
|
comment on table scott.BONUS
is '奖金表:记录一个雇员的工资及奖金' ;
comment on column scott.BONUS.ENAME
is '雇员姓名' ;
comment on column scott.BONUS.JOB
is '雇员工作' ;
comment on column scott.BONUS.SAL
is '雇员工资' ;
comment on column scott.BONUS.COMM
is '雇员奖金' ;
|
(4)SALGRADE:工资等级表,一个公司是有等级制度,用此表表示一个工资的等级。
NO 字段 类型 描述
1 GRADE NUMBER 等级名称
2 LOSAL NUMBER 此等级的最低工资
3 HISAL NUMBER 此等级的最高工资
添加备注说明:
1
2
3
4
5
6
7
8
|
comment on table scott.SALGRADE
is '工资等级表:记录一个工资的等级' ;
comment on column scott.SALGRADE.GRADE
is '等级名称' ;
comment on column scott.SALGRADE.LOSAL
is '此等级的最低工资' ;
comment on column scott.SALGRADE.HISAL
is '此等级的最高工资' ;
|
4 表之间关系图
本文转自stock0991 51CTO博客,原文链接:http://blog.51cto.com/qing0991/1365571,如需转载请自行联系原作者