1 |
lat |
1.1 |
-- ======================================================================
|
2 |
|
|
create sequence seq_person;
|
3 |
|
|
create sequence seq_physics_group;
|
4 |
|
|
|
5 |
|
|
-- ======================================================================
|
6 |
|
|
create table t_person
|
7 |
|
|
(id integer not null,
|
8 |
lat |
1.2 |
name varchar (1000) not null,
|
9 |
|
|
distinguished_name varchar (1000) not null,
|
10 |
lat |
1.5 |
contact_info varchar (1000) not null);
|
11 |
lat |
1.1 |
|
12 |
|
|
create table t_physics_group
|
13 |
|
|
(id integer not null,
|
14 |
lat |
1.2 |
name varchar (1000) not null,
|
15 |
lat |
1.5 |
convenor integer /* not null? */);
|
16 |
lat |
1.1 |
|
17 |
|
|
-- ======================================================================
|
18 |
|
|
alter table t_person
|
19 |
|
|
add constraint pk_person
|
20 |
|
|
primary key (id)
|
21 |
|
|
using index tablespace CMS_DBS_INDX01;
|
22 |
|
|
|
23 |
|
|
alter table t_person
|
24 |
|
|
add constraint uq_person_name
|
25 |
|
|
unique (name);
|
26 |
|
|
|
27 |
|
|
alter table t_person
|
28 |
|
|
add constraint uq_person_distinguished
|
29 |
|
|
unique (distinguished_name);
|
30 |
|
|
|
31 |
|
|
--
|
32 |
|
|
alter table t_physics_group
|
33 |
|
|
add constraint pk_physicsgroup
|
34 |
|
|
primary key (id)
|
35 |
|
|
using index tablespace CMS_DBS_INDX01;
|
36 |
|
|
|
37 |
|
|
alter table t_physics_group
|
38 |
|
|
add constraint uq_physicsgroup_name
|
39 |
|
|
unique (name);
|
40 |
|
|
|
41 |
|
|
alter table t_physics_group
|
42 |
|
|
add constraint fk_physicsgroup_convener
|
43 |
|
|
foreign key (convenor) references t_person (id);
|
44 |
|
|
|
45 |
|
|
-- ======================================================================
|
46 |
|
|
create index ix_physicsgroup_convener
|
47 |
|
|
on t_physics_group (convenor)
|
48 |
|
|
tablespace CMS_DBS_INDX01;
|