概述
scott用户的四张表(emp,dept,bonus,salgrade)的建表语句
emp
-- 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 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);
dept
-- Create table
create 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
);
bonus
-- Create table
create table BONUS
(
ename VARCHAR2(10),
job VARCHAR2(9),
sal NUMBER,
comm NUMBER
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255;
salgrade
-- Create table
create 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
);
最后
以上就是耍酷睫毛膏为你收集整理的oracle中scott用户dept表,oracle下scott用户的四张表(emp,dept,bonus,salgrade)的建表语句:-Oracle...的全部内容,希望文章能够帮你解决oracle中scott用户dept表,oracle下scott用户的四张表(emp,dept,bonus,salgrade)的建表语句:-Oracle...所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复