创建表
– Create table
create table EMP
(
EMPNO NUMBER(4) not null,
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7,2),
COMM NUMBER(7,2),
DEPTNO NUMBER(2)
)
tablespace SYSTEM
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64
minextents 1
maxextents unlimited
);
– Add comments to the columns
comment on column EMP.EMPNO
is ‘员工号’;
comment on column EMP.ENAME
is ‘员工姓名’;
comment on column EMP.JOB
is ‘工作’;
comment on column EMP.MGR
is ‘上级编号’;
comment on column EMP.HIREDATE
is ’ 受雇日期’;
comment on column EMP.SAL
is ‘薪金’;
comment on column EMP.COMM
is ‘佣金’;
comment on column EMP.DEPTNO
is ‘部门编号’;
– Create table
create table DEPT
(
DEPTNO NUMBER(2),
DNAME VARCHAR2(14),
LOC VARCHAR2(13)
)
tablespace SYSTEM
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64
minextents 1
maxextents unlimited
);
– Add comments to the columns
comment on column DEPT.DEPTNO
is ‘部门编号’;
comment on column DEPT.DNAME
is ‘部门名称’;
comment on column DEPT.LOC
is ‘地点’;