创建表

– 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 ‘部门编号’;
SQL经典实例-创建表
– 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 ‘地点’;
SQL经典实例-创建表

相关文章:

  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-30
  • 2021-12-04
  • 2021-09-16
  • 2021-11-30
  • 2021-12-27
  • 2022-02-27
相关资源
相似解决方案