我是靠谱客的博主 帅气红酒,这篇文章主要介绍oracle下scott用户的四张表(emp,dept,bonus,salgrade)的建表语句:,现在分享给大家,希望可以做个参考。

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

  1. emp
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
-- 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);
  1. dept
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-- 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 );
  1. bonus
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
-- Create table create table BONUS ( ename VARCHAR2(10), job VARCHAR2(9), sal NUMBER, comm NUMBER ) tablespace USERS pctfree 10 initrans 1 maxtrans 255;
  1. salgrade
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- 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用户的四张表(emp,dept,bonus,salgrade)的建表语句:的全部内容,更多相关oracle下scott用户内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(67)

评论列表共有 0 条评论

立即
投稿
返回
顶部