oracle下scott用户的四张表(emp,dept,bonus,salgrade)的建表语句:

来源:互联网 发布:软件开发工程师考试 编辑:程序博客网 时间:2024/05/05 07:20

scott用户的四张表(emp,dept,bonus,salgrade)的建表语句

  1. emp
-- Create tablecreate 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 USERS  pctfree 10  initrans 1  maxtrans 255  storage  (    initial 64K    next 1M    minextents 1    maxextents unlimited  );-- Create/Recreate primary, unique and foreign key constraints alter table EMP  add constraint PK_EMP primary key (EMPNO)  using index   tablespace USERS  pctfree 10  initrans 2  maxtrans 255  storage  (    initial 64K    next 1M    minextents 1    maxextents unlimited  );alter table EMP  add constraint FK_DEPTNO foreign key (DEPTNO)  references DEPT (DEPTNO);
  1. dept
-- Create tablecreate table DEPT(  deptno NUMBER(2) not null,  dname  VARCHAR2(14),  loc    VARCHAR2(13))tablespace USERS  pctfree 10  initrans 1  maxtrans 255  storage  (    initial 64K    next 1M    minextents 1    maxextents unlimited  );-- Create/Recreate primary, unique and foreign key constraints alter table DEPT  add constraint PK_DEPT primary key (DEPTNO)  using index   tablespace USERS  pctfree 10  initrans 2  maxtrans 255  storage  (    initial 64K    next 1M    minextents 1    maxextents unlimited  );
  1. bonus
-- Create tablecreate table BONUS(  ename VARCHAR2(10),  job   VARCHAR2(9),  sal   NUMBER,  comm  NUMBER)tablespace USERS  pctfree 10  initrans 1  maxtrans 255;
  1. salgrade
-- Create tablecreate table SALGRADE(  grade NUMBER,  losal NUMBER,  hisal NUMBER)tablespace USERS  pctfree 10  initrans 1  maxtrans 255  storage  (    initial 64K    next 1M    minextents 1    maxextents unlimited  );
0 0
原创粉丝点击